views:

74

answers:

2

Will Zend Framework 2 continue to place underscores in front of private members and methods of classes? e.g:

class blah {
    private $_name;

    private function _doSomethingToName()
    {
    }
}

I see that they are still there in the dev release of ZF2.

A: 

Yes, and why shouldn't they? It's a convention to do so.

Tim
Why not? Its nearly useless and looks ugly :-) When you use an big framework like Zend you use an ide too, wich is able to show you private and protected functions with an nice image.
ArneRie
@ArneRie well there is always that one time you dont have an ide and have to fix something. Its in my opinion very bad practice to code one way because of an IDE`s feature.
Iznogood
@Iznogood than is there still the protected/public keyword in front of the function. Please give me one good reason to use an underscore!
ArneRie
@ArneRie If you browse through some code within a method, you can directly see which other methods are private or public, without checking the method itself.
Tim
@ArneRie What Tim said. And you know you do not have to follow these guidelines. If you want to use files1.php trhu files999.php and vars named hello123 thru hello999 you are free to do so. After a while you will see why conventions are a good thing.
Iznogood
+2  A: 

Probably yes, accodring to the poll:

There are currently 381 responses:

  • 57% vote "Yes" (to remove the underscores)
  • 38% vote "No" (to retain underscores)
  • 4% vote "No opinion"
takeshin
+1 for providing source
Benjamin Cremer
Thanks for the stats takeshin. So I guess we just sit tight and see. Does anyone have any idea how far away a beta release is?
waigani
@waigani Just clone the development repository and see how far away it is.
takeshin