Why the Light Has Gone Out on LAMP 443
menion writes to tell us that Cliff Wells has an editorial calling into focus some of the perceived problems with LAMP. Wells calls PHP and MySQL this generation's BASIC citing 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."
Re:Bad programmers are still bad programmers! (Score:3, Informative)
Misguided (Score:3, Informative)
If you need some prospective; about 3/4th's of my google searches for a specific topic (i.e. "stegosaurus" and not "Error no. 43245") have wikipedia in the top 10. That's pretty significant traffic wise...
Re:What he is suggesting (Score:2, Informative)
Transactions basically make sure that multiple, individual, changes in a database are either committed "all-at-once" or "none-at-all". Consider a site which requires 5 steps to registration, if step 3 fails without transaction support, some tables may contain incomplete data. AFAIK, the latest version of MySQL (which isn't typically the version installed on webhosts) supports transactions.
Referential integrity means that if a column in table A points to a column in table B, the record in table B must exist prior to a record in table A referring to it. This features is also used to ensure integrity of the database in other scenarios. In MySQL, you'll have to manually ensure all cross-references are valid.
Re:What he is suggesting (Score:5, Informative)
Transaction support in MySQL doesn't depend on the version, it depends on the storage engine you're using for your tables. The InnoDB, NDB Cluster, and BerkeleyDB storage engines all support transactions. InnoDB also supports foreign keys. InnoDB has been available in the -max releases since MySQL 3.23.43a (early 2002) and has been part of -all- MySQL releases since 4.0 (late 2002). Any web host offering a MySQL server that doesn't support transactions and referential integrity either can't be bothered to update their software at least once every 4 years, or else they're building their own and deliberately leaving out InnoDB. In either case, you need to find another hosting company.
Re:What he is suggesting (Score:3, Informative)
All commercial software vendors generally prohibit benchmarking to some extent these days. Yes, Oracle and IBM too. The idea is to prevent "bad" benchmarks by improperly configured setups. Most vendors' service organizations will assist journalists and even end-users with performing standard benchmarks (sometimes for a price).
As for SQL benchmarks, they do exist. And Microsoft SQL Server fares very well (espicially on a price/performance basis). See the non-clustered TPC-C benchmarks for four-socket servers [tpc.org] for example. I've never seen a TPC result for an open source database listed. Why? Probably because MySQL and even PostGres can't scale like the commercial DBs, and nobody wants to invest time and money it takes to making a sucessful benchmark submission for a product they can't actually sell.
Note that Oracle has largely stopped submitting TPC results, as they've been getting their ass handed to them by MSFT and IBM so regularly.
Re:It's just a tool == Then use the best tool (Score:1, Informative)
> If you want to quickly put together a site because your purpose isn't actually maintaining the > site but putting up some content, use PHP.
> If all you want to do is create a simple program to do a one-off task, use BASIC.
> If you want to create a straightforward GUI for a database, use Delphi.
- If you want high-performance access to single DB tables (which many webapps do), use Java's JDBC.
- If you want high-performance access to multiple DB tables, use Java's JDBC.
- If you want to quickly put together a site because your purpose isn't actually maintaining the site but putting up some content, use XHTML or Java's JSP.
- If all you want to do is create a simple program to do a one-off task, use Java.
- If you want to create a straightforward GUI for a database, use Java.
- If you want a mutlithread application, use Java.
- If you want a client-server app, use Java.
- If you want a peer-to-peer app, use Java.
- If you want to write a simple script that runs on Linux, Windows, Mac, or all of them, use Java.
- If you don't have time to debug and just want something that's easy to put together, use Java.
- If you have an enormously complex project and need something maintainable, use Java.
Hmmm, I'm noticing a pattern here...
Re:unroll your joins (Score:3, Informative)
Try dumping the left join and using simple queries" is the first thing I suggest to my junior developers when they have gone and done the competent thing and ended up with a web app query that takes a full minute to return a result. Once they actually analyze the problem (instead of just trying to brute-force it with a MySQL one-liner), they usually discover there are other shortcuts and optimizations they can make, too. They may end up with 100 lines of code instead of 1 query, but they also end up with a much better application, because that 1 query was just an alias for 50,000 lines of code and a full minute of disk thrashing in MySQL.
I know nothing about MySQL but this doesn't sound right. What's the point of having a relational database if all you do is use it as a flat storage with all the relations done in code? I agree that sometimes it is necessary to do things the painstaking way, but usually with a RDBMS you handle such issues with clever indexing and table design. If your queries are so slow with a regular load then there's something badly wrong with your database or your database design.
Code is Code (Score:3, Informative)
Vaguely written rants laced with trendy buzzwords and university eggheads flaunting their scholarly beaks at plebian programmer tools aside, let's look at why LAMP has been and will continue to be a viable web development platform.
First, I've coded on just about all platforms, from COBOL, REXX/CLIST and Assembler on IBM mainframes to C on Unix boxes to LAMP to Ruby (including some RoR apps). And, code is code — in the hands of an unskilled practicioner, the product is going to be crap no matter what the tool. And a gifted artisan can craft a masterpiece with nearly any tool.
There's a great deal I detest about PHP. But, any language that I've toiled in for over a few years in writing relevant legacy code/enterprise applications/dynamic web software shows its unsavory side. No such thing as the one true programming language exists — they're all just tools, and just as they have their selling points that shine, they all suck in some sense of matter.
Anyway, here's a short list of why LAMP is good.
Having laid a case out for LAMP out, let me share some concerns about future LAMP direction:
Re:It's just a tool (Score:3, Informative)
For almost 90% of the clients I went to and I brought up the topic they all said these are the requirements and we will never need to expand on them, Of course they are 100% wrong. But what can you do, you need to eat, so you take shortcuts to save on development time and you make up for it in maintenance.
Re:It's just a tool (Score:2, Informative)
This is why I love clients that have been previously burned by some code & cash developer [team]. They understand what the consequences of "low quality" mean, and are willing to pay to avoid it.
The more educated the client, the higher the demand for quality. It's just a shame that so many need to be burned to be educated.