What other language can you name...
Posted Dec 12, 2011 22:31 UTC (Mon) by
khim (subscriber, #9252)
In reply to:
Facebook's "HipHop Virtual Machine" released by hingo
Parent article:
Facebook's "HipHop Virtual Machine" released
So yeah, PHP could have been better and nowadays it is much better than 3.x series, but if you look at the alternatives, you might appreciate it more.
Are you sure? Out of popular contemporary languages two are the worst by far: PHP and JavaScript. Well, bash is close (if you want to call it "programming langauge").
The problem is not in some language constructs but in the very core of these languages. They were designed to "help" the developer. If construct makes no sense (for example if you try to compare integer and string) then PHP and JavaScript try to do "something sensible". The end result is disaster. When your language can declare that "A == B", "B == C" yet "A != C" or if asseritions "A < B", "B < C" and "C < A" are all true... it's hard to be sure in anything. Well, you can use === exclusively (but this makes PHP similar to bash where natural thing creates problems and proper thing look unnatural), but there are no easy solution to second problem.
JavaScript is necessary evil: it's impossible to do any web programming without JavaScript. But PHP... just say no. Easy and simple.
P.S. You may say that C exhibit similar idiosyncratic behavior when floating point is involved. Sure - but floating point is pretty hard to do right in any language. This is well-known problem with similarly simple solution: use fixed point where you can floating point where you must and be extra careful if you do. In PHP it does not help you much...
(
Log in to post comments)