-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|643|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Link Home -> Help/Tutorials


 
Afr0
Created : 11 April 2012
 

Why PHP sucks



https://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
This article made me reconsider whether doing client patching in PHP was a good idea.
I posted it under "Help/Tutorials", because it makes the best argument I've ever seen (besides just being funny) for why PHP is an abomination of a language that should not be used unless strictly neccessary, ideally not at all.

 

Comments


Wednesday, 11 April 2012, 12:22
JL235
A very thorough article, with lots of legitimate complaints. However in practice very few of these really bite you when writing PHP. You encounter them from time to time, but very rarely is it regular.

Given the choice, I'd rather lose the $ symbol then have all of those issues solved. Leaving that out happens far more often then anything else.

Projects like Wordpress also easily outweigh giving up on PHP, in that a complete and mature blogging platform is much more useful then a more mature language.
Thursday, 12 April 2012, 06:55
Afr0
Given the choice, I'd rather lose the $ symbol then have all of those issues solved. Leaving that out happens far more often then anything else.


I disagree. PHP is... dare I say it, "ok" for writing small extensions to Apache, but that's about it.
Friday, 13 April 2012, 01:58
JL235
This bug was posted on Reddit recently. It also helps to show how flakey PHP is around the edges.
Friday, 13 April 2012, 05:37
steve_ancell
I don't know enough about PHP yet to know why it sucks, but all the time it's free and readily available, it's probably not going to phase-out anytime soon.
Friday, 13 April 2012, 06:49
Afr0
This bug was posted on Reddit recently. It also helps to show how flakey PHP is around the edges.


That isn't new. The article I linked to adresses this;

== is useless.
It's not transitive. "foo" == TRUE, and "foo" == 0 but, of course, TRUE != 0.
== converts to numbers when possible, which means it converts to floats when possible. So large hex strings (like, say, password hashes) may occasionally compare true when they're not. Even JavaScript doesn't do this.
For the same reason, "6" == " 6", "4.2" == "4.20", and "133" == "0133". But note that 133 != 0133, because 0133 is octal.
=== compares values and type except with objects, where === is only true if both operands are actually the same object! For objects, == compares both value (of every attribute) and type, which is what === does for every other type. What.

Sunday, 15 April 2012, 15:59
Stealth
Most of the strange function syntax is resolved with a framework.
Wednesday, 25 April 2012, 16:55
Evil Roy Ferguso

The PHP Hammer.