Why the light has gone out on LAMP
Filed under: php mysql lamp rantsNOTE: I've just migrated a ton of old articles from Frog (the old blogging software I was using) to this blog and I've yet to convert the comments to the new markup format. Also I deleted a shitload of spam and idiotic comments, so if I accidentally deleted yours, sorry. If you were a spammer or shithead, not so sorry. That should explain any disjointed comments though (and no, I didn't delete all the negative ones, just the ones that added so little as to not be worth the 50 or so bytes of bandwidth they cost).
Please read the latest article before flaming this one. This one will still be here when you get back. I promise.
Open source software has fought a long battle to get where it is today, and at least 3/4 of the so-called LAMP (Linux, Apache, MySQL, PHP) stack are under vigorous attack by many, myself included. Why?
I can't speak for everyone, or for that matter, anyone but myself, but I'm good at doing that so here goes.
I'm quite opposed to using MySQL and PHP, and I'm none too fond of Apache. Anyone who knows me or happens into a conversation with me about development quickly learns of my distaste for these particular projects. To be fair, Apache is the least problematic of the three and if there were no alternatives, I'd use it without a lot of complaint.
MySQL and PHP, on the other hand, really raise my ire. Both of them have two major problems:
- Bug ridden (by this I am including both misfeatures as well as actual bugs).
- They encourage bad habits.
I'll start with MySQL. I learned databases on MySQL and used it for several years. Then I discovered PostgreSQL and realized that in fact, I'd learned nothing of databases. For years the MySQL developers were quite vocal that things like referential integrity, transactions, subselects, etc were little more than baggage that could be done better another way. They were after speed, pure and simple. Fair enough, in some respect, since the job MySQL was originally developed for didn't require any of those things. The problem is that a whole generation of database programmers believed them, despite the fact that their applications did require those things. Someone in authority told them they didn't and they bought it (and still buy it). Let me clue you in: you need these things or you need to let someone else handle your database work for you.
Another nit I have with MySQL is the ever-changing ways you must interact with it. Some versions have certain command-line flags, and later versions will ignore those flags (or fail if you pass them),
IMO, MySQL once filled a niche (cheap data store) that today is better filled by SQLite but has moved out of it into a area where it doesn't compete nearly as well (that of an enterprise database) and no longer fits in either. If you need a dumb data store, use SQLite. If you need a FOSS database, use PostgreSQL. They cost the same as MySQL (free) and each does a better job of doing what it was designed for than MySQL.
PHP is another sore spot for me. I've gotten to the point that not only will I not write PHP code, I won't even run applications written in PHP (my long search for decent blogging software was due to the restriction that it not be written in PHP). At some level PHP is a great language because the entry cost is so low. Not so much because the language is so particularly friendly, but because it was designed to work in an extremely simple environment (the web) and because it's quite possible to learn PHP incrementally by intermixing it with HTML. So what's the problem? Well, first of all, as anyone who's done much web programming will tell you, mixing code with markup is not a good thing if you care about maintenance or extensibility. The very thing that makes PHP a great language for beginners is the very thing that makes it a bad language for beginners. At some point they will have to unlearn those habits, except that usually they don't. Also, because it's so easy to whip out a quick PHP webapp, many, if not most, PHP programmers fail to delve very deep into the realm of programming, preferring to sit at the edge and reap the benefits without the work (I'm not talking about coding work, rather the work of understanding your field). PHP programmers practically popularized the most common attack in the world, the SQL-injection attack. Not only is it the most common, it's the most easily avoided. That's how shallow most PHP-programmer's knowledge is. "Professional" programmers are still assembling SQL queries by concatenating strings.
PHP and MySQL are this generation's BASIC, the language that was described thusly by the Free Online Dictionary of Computing
BASIC has become the leading cause of brain-damage in proto-hackers. This is another case (like Pascal) of the cascading lossage that happens when a language deliberately designed as an educational toy gets taken too seriously. A novice can write short BASIC programs (on the order of 10-20 lines) very easily; writing anything longer is (a) very painful, and (b) encourages bad habits that will make it harder to use more powerful languages well. This wouldn't be so bad if historical accidents hadn't made BASIC so common on low-end micros. As it is, it ruins thousands of potential wizards a year.
Replace BASIC with PHP or MySQL (and "low-end micros" with "cheap hosting") and you've got today's most common programmer. Worse, the most common programs in existence today mix the two in a brain-freezing mixture of stupidity.
MySQL and PHP have helped quite a bit in bringing open source into the mainstream. Let's thank them for that and move on, graciously ignoring the millions of minds they've destroyed.





