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

Speaking of readability: Just `pri` as the constructor? When having just a quick glance at code I want to know which part does what. Function names help, even if it is __construct.

And the @str title=null line above the class seems very odd.



pri's not a constructor in this language's terms, it's just a visibility operator. The language wants you to be able to use code in your class member assignment statements; if that means it has to generate a constructor to make it happen, it will. Or maybe it just wants you to start coding without fussing with boilerplate.

And the @str title=null line above the class seems very odd.

This is great because you can indent code under it that's relevant to it, that would normally end up cluttering your function's narrative up with housekeeping for variables.

This is a much more pleasant way to deal with PHP. Check out the documentation, it is outstanding. http://code.google.com/p/php-snow/wiki/Class


I'm not sure I understand your comment - the function name in this case is "render_row()", and "pri" refers to the visibility of the function.

I don't feel that it's more readable, or even easier to write, as "pri", though.


pri is used first for the constructor (right after class SumTable) but not followed by any name. I find it quite hard to read this way.


Ah - I missed that entirely, thanks for pointing it out again. That line may just win the prize for least-clear line in the Snow example.




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

Search: