QUOTE(emtee @ Oct 25 2005, 03:26 AM)
What's so wrong with php so that you refer it as a "language"?
I could probably write pages on this, but I'll try to summarize.
1. The single biggest reason is that the language is poorly designed from the get go. It has all the marks of being a toy language that has been extended in a kludge-like fashion over time, but without any serious thought going into long term design.
2. It has no formal semantic. This isn't always necessary for a powerful language (c and c++ didn't have one either), but it is usually necessary for a powerful, well-designed language that is easy to understand and to extend in a clean fashion (witness the ugliness of C++ mandated by adhering to previous C syntax, when C wasn't really designed for the type of things C++ does).
3. The syntax is overly verbose and often superfluous. Part of this comes from copying some of C's inferior syntax, and part of it comes from just adding more unnecessary stuff on top of that. Stuff like prefixing variables with $ is totally unnecessary, and is just one of many examples. In a language like Perl, where symbolic prefixes actually
mean something, it's one thing, but in PHP it just reflects poor design once again.
4. Related to 3, PHP is pretty horribly inexpressive. There's very little in the way of syntactic sugar, and there's little support for functional programming. You have a few basic things like map, filter, and reduce defined for arrays, and a really ugly and hackish anonymous function facility (string based, rather than code based!), but they're setup in such a way that they wouldn't be very useful for anything really advanced. Beyond that, it doesn't have closures, currying, pattern matching, array/list comprehension, laziness, etc. This isn't even to mention other much more advanced features that most modern advanced languages might feature such as higher-order parametric polymorphism with quantified types, type classes, monads, arrows, uniqueness typing, implicit parameters, continuations, concurrency, lazy streams, constraints, etc., etc., etc.
5. Not scalable. PHP only recently even got OOP AFAIU. And on top of that, it's support for classes is very weak (not to mention quite slow) compared to something actually useful like in C++. OOP is by far not the only way (and possibly not the best even) to handle scalability, but what other non-OOP languages use to deal with this problem, PHP does not have either.
6. No metaprogramming. Nothing like C++ templates, LISP or Scheme Macros, or templates in Haskell, etc. This is a real shame because for the kinds of tasks PHP is used for, metaprogramming can tremendously cut down on boilerplate code, as well as improving efficiency, reducing errors, and improving maintainability.
7. Poorly designed integration with webpage content. PHP's cut and paste style integration with web pages might have been a good idea years ago when non-standard HTML code abounded and people weren't concerned so much with structural validity of code, or the ease of maintenance of such code and integration of it with other tools, but that is no longer true today. Something like Zope's Page Templates, which allow integration of python code into
completely valid XML, is a much more elegant solution. Not only does it make page maintenance way easy, and allows for separation of concerns, but it also allows people to use the same tools for dynamic pages that they use for static pages. Yes, there is a sort of Page Template implementation in the 3rd party PHPTAL library, which basically copies the syntax and semantics of the Zope version, but since PHP was not built with this style of implementation in mind, it's a lot more limited than what you can get with Zope and Python.
8. Relatively weak development tools and environment. Due to the nature of the language, and the lack of a coherent runtime environment like you get with many alternatives to PHP, PHP just isn't very strong on this front. A lot of this has to do with the fact that PHP has no real non-webpage centric basis. Maybe there's something really good out there that I don't know about, but I've certainly never seen anything free or fairly cheap that is nearly as powerful as the tools I use for any other of the dozen or so languages I program with.
9. Slow. PHP just isn't very fast compared to most real languages. I don't think there's much else to say there.
I could go on, but that's probably enough. PHP is OK as a toy-like scripting language for very small projects that have no need for anything advanced whatsoever. But this doesn't really mean much insofar as making it a complete and powerful programming language. Sure, maybe it's Turing complete, but then so are
Brainfuck and
Unlambda.