News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Leszek Stachowski's Blog:
php anachronic coding standards
October 18, 2010 @ 13:46:27

In a new post to his blog Leszek Stachowski wonders about a coding convention that's still widely used when it comes to private methods in a class - the underscore prefix.

The question which comes instantly to my mind is: why? Is there any reason why this convention should be kept when PHP object oriented programming has gone a long way since PHP 4 (when there was no access modifiers and such underscore was the only fast way to distinguish public from, hmm, not public methods and properties) ? Are, for instance (as one of major OOP languages), Java coding standards pushing towards such naming convention? No!

He, like many other developers, are pushing to drop this kind of convention as an outdated reminder of the PHP4 days when "private" didn't exist in the language. Scope modifiers have done away with the need for that underscore completely.

0 comments voice your opinion now!
coding standard private method underscore opinion


blog comments powered by Disqus

Similar Posts

Reddit.com: PSR-6 Caching Interface and PSR-5 PHPDoc enter Draft status

PHPBuilder.com: phpwiki - The Wiki for PHP Developers

PHP-Coding-Practices.com: Composing Methods: Introduce Explaining Variable

Artur Ejsmont's Blog: How to structure a Zend Framework application and it's dependencies

Johannes Schluter's Blog: Data structures in PHP 5.3


Community Events





Don't see your event here?
Let us know!


developer voicesoftheelephpant language interview list bugfix deployment podcast library release symfony series laravel framework api community introduction zendserver conference tips

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework