Jun42006

Why the light has gone out on LAMP

Filed under: php mysql lamp rants 

NOTE: 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:

  1. Bug ridden (by this I am including both misfeatures as well as actual bugs).
  2. 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.



135 comments Leave a comment


Feb142008

Is there anything about MySQL that isn't broken?

Filed under: mysql rants 

Just one more reminder why I refuse to use MySQL for anything:

$ ssh user@domain.com -L8888:localhost:3306

then, in another shell:

$ mysql --port=8888 --host=localhost somedatabase
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Why do people use this turd?



2 comments Leave a comment


Oct32008

Dear MySQL: fuck you too

Filed under: mysql rants 

Unless you've never used MySQL, I don't think this needs much justification.



2 comments Leave a comment


Oct22006

Bush Declares Martial Law

Filed under: bush politics rants 

Welcome our new dictator.

I think the first people to be prosecuted under this bill should be its authors for attempting to destroy our way of government and life from within. How long has this infiltration been going on?

The Bush administration has systematically destroyed every law ever made to protect American citizens from their own government, and yet I'm still amazed at the temerity of this. Will the next step be not simply not doing things labeled as "terrorist acts", but actual requirements to prove your allegience?

To quote Attorney General Alberto Gonzales: "When courts issue decisions that overturn long-standing traditions or policies without proper support in text or precedent, they cannot - and should not - be shielded from criticism". Ironically, Gonzales doesn't apply this same reasoning to the Executive branch of our government. Apparently the courts should be criticised for overturning long-standing traditions and policies but that anyone who criticises the Executive branch should be imprisoned and tortured until they confess, and then possibly put to death.

You might convince yourself that "well, the wording might allow them to do that, but they never would", but then you'd be a fucking idiot. Bush has already stated publicly that he does whatever the law allows. He further clarified that he meant this in terms of the fullest extent of the law. If the law allows him to kidnap and torture U.S. citizens, he will.

Double-plus ungood.



0 comments Leave a comment


Sep82006

Tired of Ignorance

Filed under: politics rants 

I don't usually discuss politics, but I'm just so fed up with ignorance and the polarization it causes. Today I received an email from actforchange.org, an advocacy group that I subscribe to regarding the upcoming ABC movie "Path to 9/11". Rather than blindly "act for change", I decided to click some of the links in the email and see what the fuss was about.

Apparently this was a mistake.

Not only was the email from Act for Change a complete misrepresentation of their sources, the sources themselves were unsubstantiated (most of the information was without source references). So I'm to understand we should take action based on distortions of other people's distortions and speculation?

Still not having learned my lesson, I continued following links and watched the speculation and arguing about slant in a movie none of these people have actually seen.

That's right. Everyone on both sides is up in arms and they haven't seen the damn movie. Much of the accusations of slant come from rumors that the Clintons pressured Disney and ABC (who are either liberal or conservative depending on whom you ask and in what context you are asking) to make some changes.

I'm supposed to care? How about this instead: I'll care when I or someone else has seen the movie and provided some actual first-hand evidence that the film is slanted in any particular way.

And here you have it: anyone who is arguing about the slant of this film who hasn't actually seen it yet is an utter and absolute buffoon. You heard it here first.

Oh, and Act for Change? You just lost a subscriber. Good work.



0 comments Leave a comment


Aug122007

Sometimes being early is inefficient

Filed under: gui apple rants 

I must be in a particularly anti-Mac-enthusiast mood today. Somehow the web is conspiring to keep me in that mood because I ran across this ancient article and it irked me, particularly this section:

But perception matters. A small but vocal class of very-small-weinered[sic] self-proclaimed PC experts has been attempting to delegitimize the Mac ever since it came out. Surely you know at least one of these guys (and they are all guys):

  • In the 1980s, they declared that graphical user interfaces were for sissies, dummies, and artists (and frequently insinuated that the three terms were synonymous). The Mac was overpriced and Apple was going out of business.
  • In the early 1990s, they declared that Windows was just as good as a Mac, although experts would never be satisfied with less than a pure command-line interface. Discordantly, they declared the Mac “a toy”, but bemoaned that there weren’t any good games available for it.
  • In the late 1990s, after everyone, including them, had switched to desktop-metaphor GUIs, they conveniently dropped their “real men stick with the command line” mantra, and instead proclaimed that Windows wasn’t merely just as good as the Mac, it was better. Or at least that it had better games. And Apple was going out of business.

Now, for reasons of full-disclosure, I'll state upfront that I was one of those people who thought GUIs were for wimps. Despite this, I happen have a huge wiener. Also, I've never thought Windows was better than anything except perhaps herpes.

But on to my response:

The reason GUI's were "for sissies" back in the 80's is because they didn't help you work more efficiently. Was it a problem with the GUI metaphor? Obviously not. The problem was that hardware was slow, memory was limited and quite frankly, very few applications from that era benefited much from a GUI. So the choices were: use a fast, efficient CLI or a slow, less-flexible GUI. Who would choose a GUI in this case? One group would be desktop publishers and graphic artists, but these folks were the minority. The other group was simply people too lazy, too stupid or too unconcerned to learn the most efficient way to accomplish a task.

Now, today, all this has changed. A CLI is still the most efficient for some tasks (i.e. remote server management), but for the most part, the GUI has caught up to the CLI in functionality, and more importantly, the hardware makes the computational inefficiency of a GUI practically unnoticable. Also the fact that all the commodity operating systems can multitask more-or-less successfully means having multiple windows is useful (I remember using Windows 3.1 solely because it allowed me to run multiple DOS windows simutaneously).

So, I'd argue it's not that "the GUI people were right all along and now the CLI people are tasting crow" so much as the way we compute has changed drastically and what was once a dumb idea now makes sense.

No doubt Steve Jobs is a visionary. But by definition, visionaries are ahead of their time and following them can make you look downright stupid.

Incidentally, remote server management is in this same boat today: stupid, lazy admins use remote desktops to manage their servers. Smart guys use SSH. Will that change? Probably, when 100Mb internet connections are commonplace and all the CLI tools have GUI equivalents. Will that make the stupid, lazy admins appear smarter or more efficient in retrospect? Only to them.



0 comments Leave a comment


Nov112007

Lies, damn lies, and... oh shut the fuck up

Filed under: zed rants 

Zed Shaw wrote an article that I find to be both highly informative and deeply annoying. Zed discusses the failures of most programmers to properly analyze performance data. His insight into the matter is really quite enlightening. Of course, that's if you can stand to listen to him past the first paragraph.

Zed spends a lot of time talking about fucking and killing, but his girlish whine only leads me to believe he hasn't done a lot of either.

He gives an example of how understanding statistics has helped him save the day:

Then I hit the DB2 database and about crapped my pants. Almost all of the queries performed great, except one query that had sub-second response on average, but a 60 second standard deviation! This was the query. I made a chart of all the different queries, marched into a meeting, slapped them on the table and said, “It’s not the database, it’s IBM’s DB2 configuration. Here’s the time measurements to prove it.”

The next day we had IBM fixing the problem (turned out to be a single update index command) and we all kept our jobs. That’s what a proper analysis method can do for you.

Talk about confounding. Here's my analysis of what Zed did right and what Zed did that was wrong (or at least pointless):

Right:

  1. Looked at the database logs and located the slow query.

Wrong:

  1. Wasted time and paper making graphs and charts that did anything except sort the execution time of queries in descending order.
  2. Slapped this handful of toilet paper on the table as if he'd done anything more than his job.

I mean seriously. Anyone who's administered a database (or any other bit of server software for that matter) will tell you that the very first thing you do when something goes wrong is check the logs. It doesn't take a PhD in rocket surgery to parse a log file looking for anomalies.

I also can't help but notice Zed didn't actually fix the problem. He just found someone to blame. I wonder if the IBM tech who actually fixed it wrote a big rant in his blog threatening to kill all programmers who can't add "a single index" to their databases.



0 comments Leave a comment


Aug132006

(Almost) all software sucks

Filed under: rants 

I'm often accused of hating all software. I really do hate a lot of it. Some I hate less than others, but overall software fails to deliver the goods for the most part.

There are however, a few bits of software that I don't hate. In fact I love them. So here's my very short list.

  1. PostgreSQL. This is undoubtedly the only software of this scale that has never disappointed me.
  2. Mochikit. Not really a large impressive project, but interesting in that not only does it not suck, it doesn't suck so much that it makes certain other software (JavaScript) suck less. That's quite an accomplishment.

I'll surely revisit this page to add others as it strikes me.

Oh, and for those who know me and wonder why Linux, Python, TurboGears and Twisted didn't make the list, here's a summary:

  1. Linux. It has suckage all over. Luckily they keep moving it so it doesn't get too annoying.
  2. Python. It differentates between statements and expressions. 'Nuff said.
  3. TurboGears. Built on a threaded web server (CherryPy). Likes Kid too much.
  4. Twisted. Awesome software, but how the fuck is a mortal supposed to use this stuff without good examples and documentation? I can't use it so it sucks.


0 comments Leave a comment


Copyright © 2007, Cliff Wells