Hacker News new | past | comments | ask | show | jobs | submit login

etfb is on the right path, but for me it just feels right. I guess that's just a personal preference, but the dollar sign is a visual indicator that a particular string is a variable, and not a function call.

For me, it makes a big difference in languages like ruby where you could either be calling a method, a monkey-patched method_missing callable, or a property in some scope.




Well, in PHP you already have a mandatory '()' at the end of function call - so it's pretty hard to confuse the two.

Additionally if your language has first class functions, it would feel kind of strange if names of some functions started with $ and others without it.


Good point. If variables can be functions and functions can be represented by variables, variable naming rules would to apply to functions both declared and assigned. Which is to say all functions. The $sigil would have to melt away or be everywhere.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: