Comment Re:PHP for mobile phones (Score 1) 115
A few problems with PHP off the top of my head:
There is no clean separation of logic and view (or MVC if you prefer that split) - the language itself encourages mixing code and presentation,
And how would a language discourage mixing code and presentation? You've got frameworks and language confused. Cake is ok MVC.
The naming conventions for the API are all over the map - any language that has functions named stuff like mysql_real_escape_string, as opposed to the still extant mysql_escape_string, has obvious problems with design philosophy. Maybe next year they'll come out with mysql_really_escape_the_string_this_time?
Yeah this is a good rant.
Strings and arrays are not proper objects, so you have to use a mix of procedural and oo code everywhere
Yeah, another good point. Doesn't exactly encourage the use of objects when manipulating your primitives reverts back to procedural.
- it'd be nice to be able to call methods on strings and chain stuff like Ruby.
Could not disagree more. Chaining is evil. Hard to debug and hard to read. Good programmers do NOT chain.
Doesn't have closures (just added to C/Obj-C by Apple).
Gahh. Neither does Java,C++ and lots of other decent languages. Closures are cool but only convenient in dynamic languages in my opinion.
Unicode strings are still not properly supported.
A point.
And then you're back to opinion. At least you listed some real shortcomings of the language.
Well, here's the one redeeming facet of php. If you know C and/or C++, you do not have to buy any books or take any courses to learn it. I realize that's faint praise but there you go. I certainly appreciate it.