Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Are you comparing a call to a definition? `trim_string "$my_str"` is no less readable than `my_str.strip()`.


I mean, I would say it is. Why are there quotes around the variable? What happens when I remove the quotes?

The quotes don't function like the parens. If this were a two argument function, you wouldn't put one pair of quotes around the whole thing. They're clearly transforming the variable somehow, but I'm not sure how and/or why they're necessary.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: