4 ms·
What I like: PHP has a good (and often overlooked/underrated) runtime, with language- and runtime-level support for running each HTTP request in a fairly isolat
by mbrubeck 17y ago
What I like: PHP has a good (and often overlooked/underrated) runtime, with language- and runtime-level support for running each HTTP request in a fairly isolated environment. It has a fairly standardized deployment model and a decent set of standard libraries, especially for common web development tasks. The built-in support for mixing code and markup in a single file makes it ultra-easy to hack together a simple web page or very small application.
What I don't like: The standard library has grown organically and without much top-down design, leaving it with too many inconsistent names/APIs, gaps and overlaps in functionality. Object-oriented programming took hold relatively late in PHP's history, so it's not used consistently in the standard library and elsewhere. The language itself has too many non-obvious pitfalls, e.g. ways that array/map indices work, and the way that type errors and type coercion are handled. Support for programming-in-the-large (e.g. first-class modules or packages) is poor. Historical convention of mixing logic and markup means it now requires extra discipline to separate them. The language doesn't seem to be evolving toward any particular vision, and it's not really flexible enough that users can evolve the language themselves (ala Ruby or Lisp).
I've worked pretty happily with PHP applications, and seen a lot of good code written in PHP. But it's not my tool of choice for new projects, for the reasons above.
- mbrubeck 17y agoI forgot another one: There's very little tool or library support for using PHP for non-web-facing scripts. I like being able to use the same languages and libraries for both web and non-web code, and to have my web apps use the large body of e.g. Ruby or Python libraries that weren't necessarily designed with web apps in mind.