3 ms·
There's lots wrong with PHP. http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
by rcfox 11y ago
There's lots wrong with PHP. http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- debaserab2 11y agoThere it is. I was just waiting for that one fractal of bad design post from 2012 that everyone references in this argument, every time. Cause, ya know, 4 years later there's probably nothing that is changed or improved. Better to just write it off completely than to do your own research and use relevant facts to shape an argument.
- cdelsolar 11y ago> 4 years later > literally just became 2016
- bionsuba 11y ago80% of the article is still true. The biggest: * It's 2016 and PHP still doesn't have a module system, Python had one in '91, Perl had one in '94, Ruby had one in '95 * inequality operators still have no === equivalent * sorting is still indeterministic when you have null values because NULL < -1, and NULL == 0 * arrays are the only containers in the language and they simultaneously act as sets, lists, and associative arrays which fucks up almost all array functions because you don't know what they will do * PHP has had exceptions for almost 10 years now and a lot of functions still require you to use their specific error function to tell if it failed. So if you don't call say json_last_error, your code will SILENTLY return the wrong thing
- debaserab2 11y ago> * It's 2016 and PHP still doesn't have a module system, Python had one in '91, Perl had one in '94, Ruby had one in '95 Composer is widely adopted and has been the standard for years now. It's not baked into the language, it's a community driven effort that has been wildly successful. > * inequality operators still have no === equivalent Still true. Pretty easy to deal with since there are functions for handling equality of all scalar types. > * sorting is still indeterministic when you have null values because NULL < -1, and NULL == 0 > * arrays are the only containers in the language and they simultaneously act as sets, lists, and associative arrays which fucks up almost all array functions because you don't know what they will do Both of these things are true. Neither of these things regularly snag me in my development, but like many other dynamic languages, they do need to be carefully designed for. Unit testing, strongly typed scalar vars (new in PHP7), or using SPL object data structures instead of language primitive help here. * PHP has had exceptions for almost 10 years now and a lot of functions still require you to use their specific error function to tell if it failed. So if you don't call say json_last_error, your code will SILENTLY return the wrong thing I can't think of a function I regularly use besides json_encode that has this problem. Much of that article was originally a disagreement with the approach PHP generally takes and is subjective in the first place. I'm not trying to sway people's opinion to actually use PHP, I'm just saying that despite the worts it is a capable language with an incredibly positive and productive community. It's no longer the dumpster fire it once was.
- jrcii 11y agoThat's been rebutted: http://forums.devshed.com/php-development-5/php-fractal-bad-design-hardly-929746.html http://forums.devshed.com/php-development-5/php-fractal-bad-... There are valid criticisms of PHP but the common citation of that article as the end of the debate on PHP's strengths and weaknesses is a mistake, especially in light of PHP 7.
- michel-slm 11y agoThat rebuttal's use of WordPress as an example of PHP done right is not very convincing... Also, Facebook and Wikipedia uses HHVM instead of standard PHP
- RhodesianHunter 11y agoHHVM is a webserver that replaces the likes of Apache or nginx, it isn't a language. Perhaps you're confusing HHVM with hack?
- pascalo 11y agoYep, an article from 2012 is totally accurate and nothing has happened since. I'm not into php dev anymore, by any means, but glancing at the improvements that have come through lately, even i have to admit that there's been a massive leap from 5.3 or so.