PHP 5.4.0 released
Posted Mar 2, 2012 13:24 UTC (Fri) by khim
In reply to: PHP 5.4.0 released
Parent article: PHP 5.4.0 released
So what language is actually better suited for the job that PHP is used for all the time?
Well, PHP is perfect for the “I don't want to learn programming, yet I still want to create something kinda working and I don't care about the fact that my site with be pwned in hurry” work.
People bash PHP all the time, and I'm really not a fan of it, but when I get right down to it... it's hard to point to any of the alternatives and say 'this is better'.
There are tons of better alternatives if your goal is to create something robust. C#, Java, Perl, Python, Ruby, etc. Sure, they don't try to “help” you thus you actually need to think when you use them, but this is the only way to create working programs anyway.
If you ignore that so many of the people that give PHP advice give absolutely awful advice (such as encouraging the use of the old mysql(i)_* functions, which make SQL injection child's play, instead of PDO)
Why these are awful? Don't cry for your hair… when they've chopped your head off. If you are using PHP then your goal is by definition to create something “kinda working… if not stressed” and mysqli functions are easier to use.
The best example of PHP's brain-dead interface (for the sake of simplicity, heh) is not even MySQL. It's pcre. Observe how pcre_compile is missing - for the sake of simplicity, of course. Well, for short strings pcre_compile takes 100 times more resources then pcre_exec so PHP just forced you to waste 99% of resources for the sake of “simplicity”. Congratulations!
Of course if you'll define a typical PHP programmer as someone who can not learn to correctly use couple of functions then there are no alternative to PHP - but is it even possible to create such alternative? Why will you want it?
to post comments)