News Feed
Sections




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

Nikita Popov:
Are PHP developers functophobic?
August 13, 2012 @ 12:58:25

In his most recent post Nikita Popov asks if PHP developers are functophobic - that, in some of his experience, they don't like to use functions.

Now, that was overly general, so let me clarify: PHP developers who have reached a certain degree of sophistication basically stop using plain functions - instead everything goes all classes and methods. At least that's the observation I made when looking at various open-source libraries and frameworks. The only type of function you'll find in any of the "high-quality" libs are anonymous functions. But that's pretty much it.

He shares concern that this "anti-function" approach can cause some bad practices to come up, specifically when developers try to force things into OOP that don't need to be there. He suggests that "helper functions" are a perfect example of individual functions that might not need to go in a class. He notes that, unlike in other languages (like Python), PHP development tends to follow the "one class, one file" route. He wonders if a shift from this method and more to a "module" approach (a more "compact" method) could be a good thing.

0 comments voice your opinion now!
function functophobic opinion class module file


blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: Make the download of large files with PHP (and lighty) very easy

Brandon Savage's Blog: A Reflection On Adopting Zend Framework - One Year Later

Volker Dusch's Blog: How i judge frameworks - Or: Let me code in peace

PHP Tip-a-Day: PHP Tutorial: Convoluted Code - Combining Ternary Operators and Anonymous Functions

Lukas Smith's Blog: A new coding standard for the PHP world?


Community Events





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


zendserver interview framework tips update install deployment opinion api symfony package list introduction community podcast series laravel language release library

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