Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

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."
This discussion has been archived. No new comments can be posted.

Why the Light Has Gone Out on LAMP

Comments Filter:
  • It's just a tool (Score:5, Insightful)

    by cerberusss ( 660701 ) on Tuesday June 06, 2006 @06:00AM (#15478318) Journal
    It's just a tool, for crying out loud. This article says something about PHP, but we have electronic engineers here using Perl. You want to see their scripts? The code looks like baby poo. But who cares? It's just a tool. And it works. Perl suddenly sucks then?

    Of course, the "wizards" will recognize a tool its deficiencies and start using something more appropriate.

  • by drspliff ( 652992 ) on Tuesday June 06, 2006 @06:08AM (#15478342)
    Ahah, to an extent I agree with this.

    On a day to day basis I'm dealing with systems written by other people, which are held together by duct tape, spit and good-will. PHP is a productive language, just as to a C/C++ developer Python/Ruby etc. is also productive and can lead to very good results.

    The problem is when you get pseudo-programmers writing code which uses 'magic_quotes_gpc' as a safety net among other things, and come PHP 6 the 'shit will hit the fan' when everybody realises that with this automatic escaping functionality isn't there any more and their web applications are open for the world to abuse.

    I think MySQL should be kept out of the question as it's more coincidence that it ended up being a PHP bed fellow, when PostgreSQL could've been in with a chance given the right circumstances.

    At the end of the day bad programmers will write bad code, it's just easy to learn languages (such as Basic and PHP) means they can write more bad code a lot quicker with (arguably) more negative impact when it folds in on it'self.

    Just my $0.02.
  • Bah! (Score:5, Insightful)

    by greg1104 ( 461138 ) <gsmith@gregsmith.com> on Tuesday June 06, 2006 @06:10AM (#15478348) Homepage
    If you're ruined simply by programming in BASIC, you never were a potential wizard.
  • by matt me ( 850665 ) on Tuesday June 06, 2006 @06:11AM (#15478355)
    In LAMP
    - Don't use MySQL. It's as dumb as it's name. Use PostgreSQL if you need a real database, use sqlite if you don't.
    - Don't use PHP, it's sloppy. Use python or perl.

    The MySQL/PHP combination has not provne itself. As stated it's left thousands of sites vulnerable to SQL-injection hacks and it's certainly not as durable and reliable as other combinations. Let's look at some of the most popular sites online, and how they cope with ridiculous quantities of traffic
    1 - Google. Uses python and their own database servers they developped. Problems? Never.
    2 - bbc.co.uk - a GIANT site supplied with continuous news and audio. Runs on perl. Nothing else could cope.
    3 - Slashdot. Copes with the traffic that destroys anything it links to. Perl again. Rarely down.
    And lastly Wikipedia. Runs with PHP and MySQL! Their servers blow weekly, copious lengths of downtime, search function regularly disabled. Pages are nearly always slow to respond. QED
  • Re:Unfinished rant (Score:2, Insightful)

    by mdfst13 ( 664665 ) on Tuesday June 06, 2006 @06:14AM (#15478366)
    "So what was the third item he was going to criticise, Apache or Linux"

    He says that he doesn't like Apache either. Just not as much as he dislikes PHP/MySQL.
  • by Threni ( 635302 ) on Tuesday June 06, 2006 @06:15AM (#15478370)
    The other guy we had some fuckwit here saying "I don't like Basic and would like to recommend that we, as an organisation, don't use it, only I'm utterly ignorant about anything vaguely technical so can someone with an irrational grudge against software products per se please provide a few irrelevant criticisms", and now this. Basic, like any other language, is a tool - a means to an end. Sometimes it's the best one, and no amount of "religious" wailing and gnashing of teeth is going to change that. Get over yourself.
  • BASIC? (Score:5, Insightful)

    by Phroggy ( 441 ) * <slashdot3@ p h roggy.com> on Tuesday June 06, 2006 @06:23AM (#15478394) Homepage
    Admittedly PHP sucks [tnx.nl], but isn't comparing it to BASIC a little harsh?

    Sure, it's easy to write crap code in PHP if you don't know what you're doing. It's considerably harder to write crap code (that actually works) in C if you don't know what you're doing. So everyone should use C, so people who don't know what they're doing can't write code? I don't think so.

    If you do know what you're doing, you can mostly use good design and practices in PHP - not as well as other languages like Perl (and I assume Ruby and Python), but a hell of a lot better than BASIC which, if I remember correctly, doesn't support local variables, short-circuit evaluation [wikipedia.org], passing arguments to subroutines and returning values, and plenty of other things I can't think of at the moment - let alone OOP. PHP at least tries. On top of that, languages like PHP have functionality built-in or readily available to deal with things like XML, databases and network I/O, so you don't have to write all of that code yourself.

    I'm thinking anyone who compares PHP to BASIC either doesn't know BASIC, or doesn't know PHP.
  • by mwvdlee ( 775178 ) on Tuesday June 06, 2006 @06:24AM (#15478403) Homepage
    I totally agree; those are just tools, and one should use them for the purpose for which they were created.

    If you want high-performance access to single DB tables (which many webapps do), use MySQL.
    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 to do something different, use a different tool. Don't bitch about a screwdriver being a bad tool for painting the walls.
  • by drspliff ( 652992 ) on Tuesday June 06, 2006 @06:28AM (#15478411)
    PHP is still relatively immature compared to Perl and Python, with (in my view) it only really becoming suitable for large commercial projects a year or two ago.

    Your examples:
    - Google: They use whatever language they want, they've been around since ~1998 when PHP was still a little baby.

    - bbc.co.uk - As far as I remember we're looking at progressive development from ~1995, around the time when PHP was only a sparkle in the postmans eye, they've got some very skilled Perl guys and smart sysadmins with years of work already in Perl.

    - Slashdot - ~1997 and started out as slow as molasses regular Perl CGI, anybody working on the same website for ~9 years in any language should be able to make it run like a dream.

    - Wikipedia ~2001, with initially being implemented in PHP in ~2002 and clustered in ~2003. Running large websites is damn hard, and your exaggeration of the problems is overrated.

    When you run into large amounts of traffic the language becomes a small part of the equation, Microsoft.com was running on VBScript (and C++) for several years, most of Yahoo is running on PHP...

    Yuch, my mouth tastes like flame bait.
  • This is silly (Score:5, Insightful)

    by DarkHelmet ( 120004 ) * <mark&seventhcycle,net> on Tuesday June 06, 2006 @06:32AM (#15478428) Homepage
    Of all the reasons he lists PHP for being a bad idea, he lists that "code" is mixed with markup. So what, ASP does this too. It's even possible to do this in Perl. Why not attack PHP for some of the things that make it really annoying.

    1. Until PHP 4.2.0, REGISTER_GLOBALS was set to ON, meaning that variables from a GET, POST or COOKIE are automatically defined as variables. Insert rules about how globals are evil here.
    2. Classes in PHP4 are horribly broken. They don't have destructors, for instance. PHP5 is better, but the install base of 5 is so low that writing software means having to appeal to PHP4 and 5. What's PHP4's general solution to not having a destructor? Register_shutdown_function(). Ew.
    3. Using XML / XSL is a great way to use a templating language within PHP. However, the libraries between PHP4 and PHP5 are entirely different, so you have to write a wrapper if you want your PHP code working on PHP4 and PHP5. Or... install an unsupported PECL module. Smarty? No thanks.
    4. On most setups I've seen, MAGIC_QUOTES are turned on. This means if you're writing something for wide use, you'll have to use stripslashes() to get them out of GET or POST. Even worse, some boxes have MAGIC_QUOTES_RUNTIME on, so you'll have to use stripslashes on anything coming back from a database.
    5. Safe mode is one of the most annoying things to work with. I see sysadmins use it as a horrible band-aid for shared hosting (what the hell ever happened to apache and the perchild MPM?). Open_basedir is annoying too.
    6. Try, catch, and throw are PHP5 only, meaning that error handling ends up being done by something stupid like set_error_handler().
    7. Namespaces, namespaces, namespaces!

    I understand that the language is getting better with PHP5 and PHP6, but nobody's jumping on board. The majority of LAMP machines out there are running Apache 1 and PHP4 instead of Apache2 and PHP5. At least MySQL 3.23 is finally going out of style and 4.0 is becoming commonplace. But look what's out now: MySQL 5.

    I really think PHP is starting to majorly stagnate and fragment. So much so, that given a few years, I can imagine something like Python or Ruby taking away some serious mindshare given a few killer apps using the language.

  • Yeah, BASIC/PHP/MYSQL is real bad, that's why all those genius programmers that use C++ never ran off the end of an array, caused a buffer overflow bug, or had any kind of memory cleanup problems... A crappy programmer is such in any language, and BASIC/PHP/MYSQL is a very useful tool for making smaller apps without having to get into the hardware details of the machine's operation.

    Handling everything about the machine is neat, but it's something that honestly just wastes your time if you need a program that: reads a file, processes data and produces output. If that's all I'm doing, then why do I need to operate at a level that the O/S is going to conflict with?
  • by SolitaryMan ( 538416 ) on Tuesday June 06, 2006 @06:47AM (#15478468) Homepage Journal
    At the end of the day bad programmers will write bad code, it's just easy to learn languages (such as Basic and PHP) means they can write more bad code a lot quicker with (arguably) more negative impact when it folds in on it'self.
    The real problem is that those easy-to-learn-but-crappy languages got expanded. If they were still small and allowed bad programmers (read: non-programmer) to write some simple apps, I wouldn't mind and I would've hailed their developers. But now these languages are getting bigger and bigger, causing bigger and bigger problems.
  • Re:Unfinished rant (Score:2, Insightful)

    by Haeleth ( 414428 ) on Tuesday June 06, 2006 @07:01AM (#15478524) Journal
    Well, I'm a great fan of Delphi-style object-pascal, maybe using it has brain-damaged me, or maybe it doesn't bear too much resemblance to original pascal, I don't know.

    The latter, I suspect. The original Pascal had some mind-numbingly dumb "features", like fixed-length strings.

    No, I don't mean just fixed-length buffers like bad C. I mean fixed-length strings. If you wanted to store a five-character string in a variable declared as a 10-character string, you had to pad it out manually with spaces.

    Delphi's actually a very nice language. If they hadn't marketed it as a Pascal dialect, it would probably have done much better. Calling it Pascal in a world full of Pascal-haters was a bit like opening a French bistro called "L'homme efféminé" in Texas the day after the invasion of Iraq. That is, not a great business move.
  • by billcopc ( 196330 ) <vrillco@yahoo.com> on Tuesday June 06, 2006 @07:24AM (#15478609) Homepage
    You lost all credibility in my eyes with that last zinger about Delphi. Delphi six years ago was just another VB, yes. Delphi today is downright scary in its breadth and performance. I haven't written a Delphi app in over a year now but I still swear by it. C++ needs to be taken down a notch or two.. sure it works, as long as you buy all the utilities to fix it :P BoundsChecker, Lint, Purify.. one isn't enough, usually. It's like MS Windows - it works once you throw in Ad-Aware, Spybot, WinRar etc.

    I guess I live in a world where time = money, thus a faster development cycle with Delphi means I can get paid and move on to the next project in record time.

    In the web world, it's like PHP vs Java. PHP is the slender, rebellious RAD tool, while Java is the fat, tempermental, old-fogey weapon of choice for people with too much time and money (that means Money^2) to spend. I'm not saying to write every app in PHP, that would be painful, but keep that Java away from the web server! It used to be that we'd write the complex logic in whatever native language we preferred, then simply used Perl/PHP as the glue - the presentation layer. What's so wrong with that practice ? It milked a whole lot more performance out of old server than today's big iron seems to handle.
  • by mwvdlee ( 775178 ) on Tuesday June 06, 2006 @07:27AM (#15478616) Homepage
    To be fair, TFA explicitely mentions referential integrity, transactions and subselects. To the best of my knowledge only transactions are starting to get into MySQL, and all three features are indeed pretty important to DB's.

    I use MySQL myself too, since it's available, free and fast, but I have also ran into the lack of referential integrity and subselects. I've not had to deal with transactions in MySQL yet, since I only use it for CMS's, but I've required transactions at work (using DB2), so I understand the need for it.

    As mentioned elsewhere; these are tools, use them where appropriate and use different tools where not.
  • by mythz ( 857024 ) on Tuesday June 06, 2006 @07:35AM (#15478650)
    Weakly typed dynamic languages do not have a future in large scale development projects. Given the average skillset of developers (i.e. not all developers having PHD's) there is a likely chance that less than perfect code will be written. The better language will be the language that is capable of producing less bugs. A common attribute of large scale development projects is that they are written by a team of developers and not everyone will know exactly how the whole system 'works'. In these cases without a doubt less bugs will be produced with statically typed languages that adhere to strongly typed interfaces.

    Dynamic languages are also poor candidates for writing re-usable well tested components, and because of theyre dynamic (anything goes) nature it is harder to produce good intelligent IDE's for them.

    The problem with statically typed languages is that they are inherently unproductive as it takes a considerable more code to produce the same outcome that can be written with dynamic code. But with more intelligent IDE's and common features being included into some statically typed languages this productivity gap is closing. If you take into account the maintenance of code (fixing bugs and adding new features) you will almost always be better off using statically typed languages for large scale projects.

    With that being said I believe languages like Boo will be the future (C# 3.0+ also looks to be on a very productive path with inclusion of features like type inference, lambda functions etc.). I like Boo cause it is a python-esque language that is statically typed (compiles to .NET). It has advanced features like first class support for regular expressions, hash tables, closures, etc. Works well with both Mono and MS.NET so it runs perfectly on both platforms and it includes a great IDE with Sharpdevelop 2.0+.
  • by /ASCII ( 86998 ) on Tuesday June 06, 2006 @07:44AM (#15478690) Homepage
    Exactly. The main problem is that incompetent programmers are producing horrible code. Some of the choices made by PHP (magic quotes, no database abstraction, register globals) make it too easy to take the wrong shortcuts, meaning that to some _small_ degree, PHP does encourage bad coding practices. But belive me, if all the PHP coders of the world where using Rails, the incompetent programmers would quickly find various ways to break and abuse Ruby as well. The first thing that would happen is that they would _completely_ ignore the MVC-model. They would _only_ put code into the rhtml template files and ignore the rest of the tree. In the end, it would only be a small improvement over PHP.

    PHP is a rather boring C-like language, with some semi-serious issues w.r.t. library consistency (compare the call signatures of the various sleep functions), backwards compatibility (PHP3 uses [] for string access, PHP5 uses {}, PHP6 will use [] again...) and possibilities to shoot yourself in the foot (Magic quotes, safe mode, etc.). It is by no means perfect, but I really don't think comparing it to BASIC is fair. Not only does PHP force you to use functions instead of gotos (thogh a special goto-like syntax will probably be added in PHP6), PHP also has a mostly sane Object model, complete with a sane reflection interface, inheritance and everything.

    And don't even get me started on MySQL. People talk about ACID, transactions and other high level concepts, but real-world PHP-programmers don't even use joins or subselects. Look at the big, famous open source PHP projects like Joomla and various Forum software. You'll find that the coders generally do multiple selects instead of a single join. They even write loops where they do two or three selects per lap in the loop where a single joined query would be enough. This isn't mysql's fault, mysql has supported joins for a s long as I've used it. This is purely a case of incompetent coders.

    So in the end, the tools that are most popular get the blame for the fact that people don't know how to use them. *meh*
  • Re:Unfinished rant (Score:4, Insightful)

    by ubernostrum ( 219442 ) on Tuesday June 06, 2006 @07:44AM (#15478694) Homepage

    Odd that he finds PHP and SQL bug-ridden, but Linux isn't.

    • He's not saying SQL in general is "bug-ridden"; he's very specifically criticizing MySQL and recommending people switch to SQLite or PostgreSQL depending on their needs.
    • Actually he's not saying that the tools themselves are "bug-ridden"; he's saying that PHP and MySQL encourage novices to learn the some bad practices.

    Today's friendly fact check brought to you by the letter "K".

  • by mwvdlee ( 775178 ) on Tuesday June 06, 2006 @07:45AM (#15478696) Homepage
    Considering the common wisdom that you'll spend far more time maintaining than developing, a fast development cycle is meaningless.
  • Airplanes suck! (Score:2, Insightful)

    by crhylove ( 205956 ) <rhy@leperkhanz.com> on Tuesday June 06, 2006 @08:18AM (#15478831) Homepage Journal
    All those pilots crashing into shit proves it! Everybody switch to bicycles!
  • by Qbertino ( 265505 ) <moiraNO@SPAMmodparlor.com> on Tuesday June 06, 2006 @08:20AM (#15478842)
    The article is rubbish and/or tells nothing new.
    Being a professional freelance web developer and familiar with various web technologies I can say this guy has got it all backwards.

    1) MySQL is not a full blown database. Big news. Would've you thunk? What this guy aparently just discovered the other day or so others have been aware of for years.
    I've got more news: Databases in general are pathetic. View logic and transactions just move the problem into the DB and away from the App. They don't really solve it. Object-relational setups and DBs do, but they are still a few years away from widespread use. In that respect Postgres and Oracle are closer to MySQL than to ZopeDB. On top of that, in order to utilize a DB properly you have to know about the problems you'll be facing. And that you learn of best by using flatfiles or it's SQL equivalent: MySQL.

    2) PHP is the web generations Basic. Very true. Does it spoil developers? No. The legend of procedural (Basic) coders lost to OOP was spread by academics who were unable to explain OOP in correct terms and context. Meanwhile people wo aren't that arrogant and mix OOP and functional programming whenever they feel like it (Symfony, Rails, Django, Zope) are kicking the collective asses of old-school hardcore 100% polymorphic OOP bloat advocates up and down the street (Java).

    LAMP isn't the end all of web technologies. Nobody has ever said otherwise without making himself look extremly silly. But LAMP is a viable solution for any project of any size if the enviroment permits using it. The tools and production pipeline are among the most sohpisiticated FOSS programms around. Half of Googles Database is filled with forum postings and tutorials on PHP. DBDesigner, Clay and MySQK Workbench make working with MySQL so easy and fast that Oracle is seriously concerned about it. A bazillion of available FOSS and commercial tools and solutions for PHP are biting huge chunks away from the serverside Java market, pushing it back to where it belongs: The client.

    Bottom line:
    LAMP isn't beautifull or notably advanced. Has never been and probably never will be.
    But it is:
    a) Extremely easy to get rolling with.
    b) Used by the largest amount of stable and mature OSS projects.
    c) Growing it's featureset and best-pratice compatibility in the same rate the general populace is becoming aware of OOP and what Databases where initially meant for.
    d) Nearly so widespread it can be considered a monopoly.
    e) Entirely FOSS.
    f) A T-Rex-sized Microsoft/Oracle/Macromedia/BEA/[fill in commercial webappserver vendor here] Boogieman.

    And that's why it will remain a wide used setup and why that's a good thing.
  • by gravyface ( 592485 ) on Tuesday June 06, 2006 @08:20AM (#15478847)

    One of the merits of PHP (and most scripting/dynamic languages for that matter) is it's transparency: it's easier to spot bad design or sloppy code because all of the code actually does something in relation to the given problem domain.

    In comparison, bad designs in an OO language may appear "correct" or even "elegant" on the surface, simply because the glue layers are *meant* to hide the details; adding a pretty "Gang of Four" veneer on top does not make it right.

  • by Threni ( 635302 ) on Tuesday June 06, 2006 @08:27AM (#15478878)
    > When, exactly, would BASIC be the best tool for a particular job?
    > Seriously?
    > The only time I can think of is if you just can't find anyone that knows how to program...

    It's the best job if you want to quickly knock up something for the Windows platform, say a tool for converting data from one format to another, then sticking the result in a database, especially if you have a few options in a front end. It's nice to be able to manipulate strings and format data on the fly - using the Immediate Window to test things out - without having the tedium of having to allocate memory (in C, for string handling) etc. Sure, if you don't need the front end and you're after speed because you're going to do this conversion often, and there's a lot to convert, then you might want to look at C/C++ using command line parameters. But some of my company's customers would find that a little daunting.
  • by Angostura ( 703910 ) on Tuesday June 06, 2006 @08:39AM (#15478919)
    Considering the common wisdom that the paying client wants the site ready tomorrow, the cost of the maintenance is something they can start worrying about after they've paid you.
  • Re:Bah! (Score:3, Insightful)

    by SQL Error ( 16383 ) on Tuesday June 06, 2006 @08:39AM (#15478924)
    Too true.

    Basic had goto and gosub, rather than procedures and functions? No decent data structures? No proper error checking?

    Welcome to how computers actually work.

    Sure it doesn't scale. But it's a good thing to learn about that sort of problem early, because every language and programming tool has scaling problems.

    A wizard can do wizard stuff in Basic. A non-wizard is a non-wizard whether he's equipped with Common Lisp or Smalltalk or Objective-C or Algol.

    Basic didn't ruin thousands of potential wizards a year, because there aren't that many potential wizards. Realistically? Couple of hundred a year, world-wide. Tops.
  • by Tony ( 765 ) on Tuesday June 06, 2006 @08:56AM (#15479008) Journal
    View logic and transactions just move the problem into the DB and away from the App. They don't really solve it. Object-relational setups and DBs do . . .

    No, they don't.

    And, what problem are you talking about? You mention a problem, but fail to mention just what this problem is.

    As far as object-relational databases: they suck far worse than pure relational databases. Relational databases are built on solid computer science-- specifically, set theory, which has its own algebra. Object-relational databases have no such solid foundation, and so are not as rigorously based in actual, real math. Hell, there isn't even a common definition of what an object-relational database is, let alone what problem domain they solve. Also, they don't provide a damned thing not already provided by a good relational database.

    Now.

    The SQL language sucks. I'll give you that. We could certainly do better. But, at least it's marginally relational, with a complete (though stupid) grammar.
  • The thing is.... (Score:3, Insightful)

    by FooAtWFU ( 699187 ) on Tuesday June 06, 2006 @08:57AM (#15479011) Homepage
    PHP is a fine hypertext preprocessor - it is simple to use, readily available, and excessively convenient. The problem comes when novices discover it, delight in its convenience, want to use it for something big and important and they don't know how.

    Granted, if they were using, say, Perl, they still probably wouldn't know how to build anything big and important, but PHP in particular provides some simple, obvious, and well-defined mechanisms to implement Bad Coding Practices. Separation of the logic and the content are the first things thrown out the window; PHP's SQL-related functions invite no end of bad design (database-specific query functions instead of something generic like Perl's DBI classes, no prepared statements, practically BEGGING for SQL injection vulnerabilities -- then there's the whole register_globals fiasco, short-tags vs long tags and magic-quotes settings just to keep you excited, and so on and so forth...)

    There are other things, too - some will point out the lack of decent namespaces, inconsistent function naming schemes, too many functions that are too similar, and such- many valid complaints, a few silly complaints -- but they pale in comparison to all the Bad Stuff that PHP invites upon itself from novice coders.

  • by WindowsTroll ( 243509 ) on Tuesday June 06, 2006 @08:57AM (#15479014) Homepage
    I remember a few years back when LAMP was all the rage. The argument went something like this: Linux rocks and Windows sucks; Apache rocks and IIS sucks; MySQL rocks and SQL server sucks; Perl rocks and everything else sucks. At the time, most web sites were running Windows/IIS/ASP/SQLServer. The conventional wisdom, on /. at least, was that you had to run Linux because all other OS were inferior and if you were truly l33t, you would run Linux. The argument for apache was that it was the "proof" that the OSS model was superior and that you should embrace the pure and virtuous model of OSS.

    I'm really surprised to see that there are knocks against MySQL, particularly the argument that it could have been PostgreSQL or SQLite. This seems like revisionist history to me - MySQL was THE END ALL AND BE ALL of databases. Referential integrity - who needs it if your programmers have a clue, and anyone arguing for this was an IT weenie or a SUIT. Anyone advocating "real db functionality" was old school and didn't realize the world had moved past them because the only important feature was speed. Boy, how things have changed. Now, his argument must be "all of the /. crowd from year back must be complete idiots." , or "Now that I'm smarter, I see that I was dumb a few years back".

    The same was true for Perl - back in the day, Larry Wall was God incarnate, and only an idiot would ever write code to sit behind a web site when you could script it with Perl. Of course, now P stands for PHP. And in this respect, the guy is just a bigot. To quote, "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)." So, even though there may be a perfect tool for me to solve a problem I need solved, I refuse to use it because it is written in PHP.

    So, what happened? Perhaps the problem is that LAMP became popular. A popular undercurrent of sentiment is that if something is popular, then it is no longer l33t, and to express how l33t you are, you need to be a champion for the next "big thing". This shows how cool you are and how much smarter you are than everyone else. The problem is, once the cause that you are championing becomes popular, you are just like everyone else.

    One of the arguments for LAMP was that it was easy to create websites. In fact, it was so easy, that you could teach your friends and family how to create web sites with LAMP. The argument was that it was just like BASIC. Now, that it has become popular and it is ubiquitous, the argument against it is that it is just like BASIC.

    You just can't seem to win.
  • Re:BASIC? (Score:5, Insightful)

    by tomhudson ( 43916 ) <barbara,hudson&barbara-hudson,com> on Tuesday June 06, 2006 @09:28AM (#15479205) Journal

    Weak typing, poor/nonexistent scoping rules and worse yet, auto-vivifying variables, are the big points of irritation.

    Having said that, if you avoid trying to use all the "features" of php, and just use it for what it was intended for - web pages (remember, PHP originally stood for "Personal Home Page"), its "good enough" 99% of the time.

    I used to write CGIs in c/c++, but I wouldn't want my stuff to share a server with someone else's c CGIs if they've only had, say, 5 years of programming experience. A badly written/implemented c CGI can bring the whole machine down. A badly written php cgi will "just" time out.

    So let everyone use the "P" glue scripting language of their choice - Perl, PHP, Python ... whatever floats your boat.

    Besides, there's one argument that should carry more weight with slashdotters than any other: More pr0n is served up by the Apache and the P languages than any other solution: specificially, the Netcraft confirms that largest pr0n site in the world is running FreeBSD/Apache/1.3.28 (Unix) PHP/4.3.6.

  • by SlappyBastard ( 961143 ) on Tuesday June 06, 2006 @09:29AM (#15479212) Homepage
    At the end of the day, good PHP code hinges on writing a good script t scrub all your GETs and POSTs.

    Hell, I worked with a kid who had math and CS degrees (I hold two degrees, but neither degree is math or CS) and he littered his code with magic quotes.

    The problem is that PHP is left in the wilderness. It's easy to learn, but too powerful to weild. But the C++ers talk it down, so there aren't enough people teaching the right way to use it.

    PHP can be brilliant. It can also be a portal into hell.

    But, ultimately, empowering new entries into the industry requires that we educate, not intimidate, them.

  • by robertsconley ( 978470 ) on Tuesday June 06, 2006 @09:33AM (#15479250)
    The problem isn't BASIC, PHP or any other entry level langauge. They are langauges allowing people with no training in computer language to create *GASP* applications.

    The problem is that a lot of people have no formal training. They often don't know about even the most basics of computer science. Things like structured programming. For database the features of referential integrity, transactions, and subselects are needed to implement important database concepts if you want software that maintains and extends easiler.

    If a langauge or database that actually hinders you from implementing best practices then criticize away. But to criticize a langauge or database because of it allow novices to start creating application is elitist and smells of snobbery.

    Rather than take a holier than thou stance of "I don't use PHP" write a tutorial on the best practices to use to make bug-free software in a timely manner. Show how they can use their knowledge of PHP/MySQL to start using better tools or *GASP* even how to use PHP /MySQL with best practices.

    I write a variety of software for machine controllers, CAD/CAM, to office management. Sometimes I don't get to work with the best langauge because of platform limitation. Sometime I have to work with assembly itself. But yet in all the platforms I use, I find my knowledge of using structured programming and other best practices applicable and helps me write good software.

    When we hire other programmer I teach just because we have nothing but jump and conditional jumps in assembly doesn't mean that you stop using structured programming.

     
  • by Anonymous Coward on Tuesday June 06, 2006 @09:36AM (#15479269)
    Well, that's somewhat true, but pretty much irrelevant.

    Personally, I think that a web application should contain the user facing stuff (CSS, HTML, images, and whatever), and a thin layer of glue code that interacts with the back-end system where all the real work happens. It's nothing more than a pretty user interface to allow people to interact with the rest of the system, and shouldn't really contain anything that needs heavy maintenance. It does three things - it allows the user to see stuff already in the system, it allows the user to interact with the system, and finally it contains basic error checks to make sure the user's not trying to do something that the back-end won't let them do anyway.

    If you have a system designed like that, it doesn't matter how maintainable the front end is. If you've changed something in the back-end so much that you need a change in the front-end to match, you're probably going to have to do parts of it from scratch anyway, no matter what you're using. It's far better to have a rapid development system.

    Same deal with building applications that have a C++ back-end, and a VB6 front end. Build the back-end with something that's maintainable over the long term, and build the front end in something that allows you to build a front end quickly and easily.

    It just happens that, with many web applications, the back end consists of a good database and nothing more. You'd be surprised how much you can get a good database to do.
  • by JWW ( 79176 ) on Tuesday June 06, 2006 @10:36AM (#15479723)
    Sorry, I just can't pass this one up.

    Customers don't want to pay out the ass again for you to add a simple feature because you didn't take the time to do it properly the first time around.

    I say that customers want exactly that. This is the model of software development that Microsoft has adopted from the start and customers can't seem to get enough of it. If customers had really wanted solutions that just worked and didn't have problems, then Unix would have been a much more dominant operating system in the late 80's and early 90's. Instead customers just wanted the next thing from Microsoft that fixed the problems from the previous version. Of course, MS's cheaper price didn't hurt, but true ROI anaysis would have show a "full" solution would have been better, even if more expensive.

    Don't get me wrong. While I'm being critical of this tactic by MS, it definately works and has worked extremely well for them. We are always waiting for the next Microsoft os that will "have everything". As Vista has shown, that will never happen, but its really because MS doesn't ever want it to happen.

    Because, in reality, thats what customers really want. Delivering now and making them upgrade (or fix) later is really what they expect. It shouldn't be, but it is.
  • by plague3106 ( 71849 ) on Tuesday June 06, 2006 @10:42AM (#15479775)
    So you can't ever post if someone else has posted a viewpoint which agrees w/yours? Wow..

    At any rate, I'm speaking from experience, having spent 7 years doing web applications exclusively. I no longer work for them (I left to move to another state), and although we were more expensive than some of our competition, we focused on 'doing it right.' Some customers left to come back later, others knew from day one that it was worth it to pay to do things right the first time.

    I still talk to my friends their, and the company is doing very well. Your function as a vendor is not to give the customer exactly what they want, part of it is to educate them on why they should want something different (because in the end, it will work better). Its called 'managing the client.'
  • by plague3106 ( 71849 ) on Tuesday June 06, 2006 @10:49AM (#15479843)
    This is the model of software development that Microsoft has adopted from the start and customers can't seem to get enough of it.

    Customers can't get enough of the fact that MS gave them exactly what they wanted. Speaking as a developer, their tools (VS) have improved steadly over the years, incorpating features I want and that make my job much easier. The same can be said for thier OS.

    Security wasn't there because customers didn't want to pay for it. So MS gave them an insecure OS. Now customers realize security is important. So MS responds with more security. There's more security coming in Vista, and Win2k3 is pretty secure right out of the box, with jsut about everything extra disabled by default.

    Your post is just MS bashing. MS gives customers what they want. Sometimes that's not good, because its not in the customers best interest (ie., no security..), but to say customers want crappy software is not accurate. They want good software that does what they want.
  • by DragonWriter ( 970822 ) on Tuesday June 06, 2006 @10:51AM (#15479868)
    The ease of use in PHP and MySQL gets people all euphoric and sloppy.

    No, it means that people that are euphoric and sloppy naturally can still use them and get something done, even if its not a bulletproof webapp suitable for the most intense uses.

    It also means that people that are more meticulous have more time to spend researching and planning the particular needs of their applications than if they were using something harder to use.

    Sure, there are times when other technologies may be the more productive choice. But ease of use is not a misfeature in a database or programming language.

  • by Theovon ( 109752 ) on Tuesday June 06, 2006 @10:56AM (#15479908)
    I started with BASIC, then learned C and Pascal. BASIC and Pascal didn't ruin me. BASIC taught me to think algorithmically. If I'd had to learn a great deal more syntax and structure to start with, I would never have gotten started. BASIC is a good way to get immediate feedback on your initial programming attempts. "10 PRINT "HELLO": GOTO 10" is a common first program that is exciting to an 8-year-old who programs something for the first time. As I developed larger BASIC programs, I ran into the pitfalls of dealing with a spaghetti language. It wasn't a problem, though. BASIC had taught me the basics, and I was ready to move on. Pascal taught me structured programming. Compared to BASIC, it was great for writing larger programs and keeping code organized. But Pascal is too strict, and when I learned what I needed from that, I was ready to move on.

    C is a language that's too powerful for a beginner. There are too many ways to hang yourself if you don't know what you're doing. Someone who has never programmed before isn't ready for it. BASIC taught me to develop algorithms, so that when I was learning C, I was struggling with the syntax and semantics separately from the process of learning to write algorithms. Pascal taught me discipline that I used to structure C programs in ways that aren't required by the compiler but necessary to keep one's code organized and managable.

    BASIC is a good thing. It's like drinking milk as a baby. Pascal is a good thing. It's like learning to get along with other kids in kindergarden. People aren't ready for C until they've gone through those stages.
  • by Anonymous Coward on Tuesday June 06, 2006 @11:06AM (#15480002)
    Along that line, I've come to learn that software development is really more like laying concrete than anything else. If you catch errors early on, great, they're easy to fix. If not, you generally have to just pay the price for them for the next 20 years until the whole thing is cracked and falling apart, and then you can rip it all up and start from scratch.
  • by poot_rootbeer ( 188613 ) on Tuesday June 06, 2006 @11:24AM (#15480146)
    Customers don't want to pay out the ass again for you to add a simple feature because you didn't take the time to do it properly the first time around.

    Customers don't want to pay out the ass for you to take the time to do it properly the first time around, either.
  • by quanticle ( 843097 ) on Tuesday June 06, 2006 @11:43AM (#15480300) Homepage

    They want good software that does what they want.

    Customers do not want "good" software. Good software is tight, clean code created using a proper development methodology. Good software takes time to create, but is far easier to maintain. Customers want "acceptable" software. As long as it does what it is supposed to, doesn't have any show stopper bugs, and is available tomorrow, the customer will take it over any "good software" available the day after. Then, when the customer reaches the limits of the hacked-up solution he/she clamors for the next version.

    This is just from my personal experience.

  • by Spacejock ( 727523 ) on Tuesday June 06, 2006 @11:46AM (#15480327)
    Absolutely. They want something that works NOW and which can improve over time. So what if it takes fifteen keystrokes to find a settings form or the tab order is up the chute? Better than endless promises of a killer app which will be ready Any Day Now, which either never arrives or sucks when it DOES arrive.
    I learnt that lesson as a teenager in the early 80's, thanks to over-hyped computer games which truly sucked when they finally (if ever) arrived. Other speccy users will know exactly which titles I'm referring to.
  • by hey! ( 33014 ) on Tuesday June 06, 2006 @11:47AM (#15480336) Homepage Journal
    It's just a tool, for crying out loud. This article says something about PHP, but we have electronic engineers here using Perl. You want to see their scripts? The code looks like baby poo. But who cares? It's just a tool.

    Well, true.

    But we live in a world where people don't seem to be very good at making distinctions. As, for example, in the difference between a screwdriver and a chisel.

    Part of this is the fault of salesman, who want you to buy their product as the one true tool for everything, and part of this is the fault of bad managers, who don't know how to make decisions, and part of this is the fault of lazy programmers, who want to stick to what they know. But reality is that there is no one perfect way to do everything. You don't want to cut a mortise and tenon with a screwdriver, nor do you want to drive a screw with a chisel. You've got to have the right tools for the job.

    Things change as you scale. As you scale projects in engineers, functionality, and users, different factors come into play. The classic example is J2EE, which is brutal productivity sucking overkill 4/5 times it is used. On the other hand, there is VB, FileMaker, Access etc., which are fine, even nearly ideal, for scratching the small itches of an individual or a small number of users. But I've seen many a project start off with an impressive spurt of "productivity" then grind to a halt because the complexity increased exponentially in time and they found out that while a Dremel tool is indeed a handy tool, it does not suffice to build a suspension bridge or a rocket ship.

    In the end good design boils down to the DRY princile: do not repeat yourself. The trick is that you have to determine exactly how you will end up repeating yourself, without letting the process suck up all your time. It's almost a Zen thing. You have to constantly think about the future and what might happen, while remaining focused on the present and what is happening. Your habits of mind must encompass both.

    The ability to anticipate the dead weight of repetition and work around it is what makes a good programmer. It's fun to sit down with something you know (e.g. LAMP) and start banging stuff out fast. It's useful too. But that doesn't mean you spew code just because you can. It is true, LAMP and every other system that is easy to use encourages bad habits among bad programmers. But there has never yet been a successful attempt to force bad programmers to think like good ones. All you get is bad programmers who get less done.
  • Re:This is silly (Score:4, Insightful)

    by drew ( 2081 ) on Tuesday June 06, 2006 @12:30PM (#15480692) Homepage
    I have many of the same complaints, and a few more.

    (A continuation of number 1) Scoping in general is completely screwed up. GLOBALS aren't actually really global. Unless you specifically bring it into scope with the "global" keyword, but even there the behavior is subtly different. Or if it's a "SUPERGLOBAL" (e.g. the variables which are registered by REGISTER_GLOBALS) which are always in scope. I also find the scoping behavior within functions to be incredibly annoying, but unfortunately that brain damage hasn't limited itself to PHP.

    (A continuation of number 4) Not only is MAGIC_QUOTES incredibly irritating, it's just not right. Most databases other than MySQL use '' instead of \' to escape characters, so adding the slash not only doesn't help, but makes it harder to clean the input. (Yes, I know about MAGIC_QUOTES_SYBASE, but in my experience, nobody uses it, instead resorting to stripslashes + str_replace.) That this is even needed as a language 'feature' is ridiculous in the first place. If they had a decent database abstraction from the beginning (or at least much earlier on than they did) that handled escaping properly, this misfeature might never have been created.

    And finally, what is with having language features being configurable in the first place? There's no clean way to write a redistributable PHP application that will reliably run on a given installation of PHP without listing a whole set of configuration options that the user needs to set in an .htaccess file (assuming that's even allowed). Some things (like MAGIC_QUOTES) can be worked around by detecting whether the option is set and running all of your input through a preprocessor that compensates for that particular feature, but others (like SHORT_OPEN_TAG) have to be enabled or disabled before your script begins to execute, and there's no way to work around them.
  • by yoz ( 3735 ) * on Tuesday June 06, 2006 @01:21PM (#15481154) Homepage
    "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.

    Y'see, I'd rather that my developers not get punished for "doing the competent thing", and get to spend their time developing new features rather than having to hand-optimise existing ones. As the other reply suggests, if an RDBMS can't properly analyse a complex query and return results faster than doing it with multiple simple queries being dumped over the network, then that RDBMS is screwed. Maybe it's just tuned badly or maybe it's terminally brain-dead, but there's definitely something wrong there.
  • by budgenator ( 254554 ) on Tuesday June 06, 2006 @01:39PM (#15481319) Journal
    GOTO's don't kill programs, programmer's do! Seriously any good programmer can write trash code in any language out there, and a good programmer can write good code in anything as well. Just because a language doesn't enforce something that lets a newbie or a hurried expect hack together some horrendous pile of stinking speghetti, doesn't make the language bad. Hell I liked RPG II better than COBOL and FORTRAN better than BASIC; one of these days I'm going to learn Lisp.

    By now I guess you've gathered that there will not be an arguement here that I not heard before.
  • by arodland ( 127775 ) on Tuesday June 06, 2006 @01:41PM (#15481340)
    PHP ain't "easy to read" by any stretch of the imagination. Thousands of functions in the core, a retarded sort of type system apparently inspired by Visual Basic which provides no clues as to what type you're actually working with, and wonderful action-at-a-distance-y "references" that really aren't? That's not so good. Complain all you like about Perl (I know you will) -- but it's possible to write clean, maintainable Perl code for any task if you're so inspired. Easy things easy, hard things possible, and all that. PHP's shortcomings, on the other hand, make it impossible to solve any even moderately complicated (read: "useful") problem without your code becoming hopelessly twisted.

    As to the "brain-damage" effect, I really have seen it. If you cut your teeth on BASIC or PHP, you think that "learning to program" == "learning to work around $language's flaws" and when/if you move on to something else, it's painfully difficult to start thinking in terms of "real" design. It really crushes a lot of people. Better to learn some basics before you start writing crap code.
  • by v3xt0r ( 799856 ) on Tuesday June 06, 2006 @01:52PM (#15481442)
    This is a completely bias view of LAMP from a Python Lover's blog. *yawn*

    There's a reason why millions of developers use PHP/MySQL instead of Python and PostgreSQL (for web sites), because it's made for the web!

    PostgreSQL and other Transactional Databases are not intended for Web Applications. Sure you can use them for that, but that would be like using PHP/MySQL for your shell scripting environment. (You can, but should you?)

    I use python, perl, php, bash, c, or whatever is best for the requirements I have.

    Web Interfaces: PHP
    Shell Interfaces: PERL
    Desktop Interfaces: Python/Gtk++

    The database you choose, is subjective to your needs.

    I like postgresql for transaction-heavy database architecture, but for most basic web apps, heavy transactional functionality slows down the performance tremendously. (Yes, even (especially) Oracle).

    I notice that this guy is a fan of Ruby, and it seems that most Ruby Fans dislike PHP, which goes both ways really. (most PHP developers who actually like PHP, dislike Ruby).

    Too each his own. To say that using Language (A) instead of Language (B) makes you smarter, is a reflection of ones own ignorance.
  • by Anonymous Coward on Tuesday June 06, 2006 @03:09PM (#15482135)

    The whole idea of BASIC (or PHP) "ruining" novice programmers is absolute nonsense.

    It's akin to saying that reading comic books as a child somehow permanently "ruins" a person, and makes it impossible for them to develop intellectually as an adult. The concept is just total crap.

    I started with BASIC back in the late 70s. Today, I am a fully-capable OO developer in C++ and C#. (I also know how to use PHP to do large-scale multi-tiered OO development.) There was nothing in BASIC that made it hard for me to later learn OO and other good programming techniques.

    Actually, to imply that I could have somehow been "ruined" by exposure to any programming language back when I was a teenager is outrageously insulting to my intelligence.
  • by alexfromspace ( 876144 ) on Tuesday June 06, 2006 @05:12PM (#15483085) Homepage Journal
    GOTO's don't kill programs, programmer's do!

    And popular languages with GOTOs raised a generation of programmers who were not told that GOTO's are bad. Later they killed many programs before learning it the hard way.

    Would you rather have that the mistakes of past are not repeated, or that you could impress younglings by avoiding the use of GOTO with the grace of an experienced developer?

  • by fbg111 ( 529550 ) on Tuesday June 06, 2006 @06:41PM (#15483710)
    FLPR [flpr.org]. There are also some interesting Python frameworks that have recently adopted the Rails team's marketing savy:

    • Turbogears [turbogears.org]. Turbogears may become the choice for webapps with more complicated database requirements, eg apps that require a relational algebra engine rather than a simple object store, given their ongoing work to integrate the SQLAlchemy [sqlalchemy.org] DB layer.
    • Django [djangoproject.com] also looks good
    • web.py [webpy.org] for a lightweight framework.
    Given the Rails-led boom in opensource RAD web frameworks, there are plenty of combinations still left for anyone wanting to make a framework out of their favorite components - Linux/BSD/etc | Apache/LightTPD/etc | PostgreSQL/MySQL/SQLite/HSQL/etc | Ruby/Python/Lisp/etc.
  • by Max Threshold ( 540114 ) on Tuesday June 06, 2006 @10:06PM (#15484663)
    "Customers don't want to pay out the ass again for you to add a simple feature because you didn't take the time to do it properly the first time around."

    They most certainly do!

    When I was first hired as a PGSQL developer, the company I was working for had two projects going. One of them we delivered to the customer without all of their original specifications met, but basically working. Having delivered a product they could see and use, they were more than happy to keep paying for features and performance enhancements. They ended up paying more in change orders than they did for the original contract, and they were damn happy about it.

    The second project was delayed because the data we were given to work with was screwed up beyond all expectations. Taking the time to "do it right" would have pushed us way past our original deadlines. But we tried anyway. Without something they could put their hands on, broken or not, the suits got anxious as soon as our deadline passed. That project ended up in arbitration.

"No matter where you go, there you are..." -- Buckaroo Banzai

Working...