Skip to main content

But, didn't PHP break the Web in the first place?

Rasmus Lerdorf is an opinionated man.

However, so am I, so I have some things to say about these particular opinions. Lerdorf is claiming the web is broken. I do not disagree. Lerdorf is claiming PHP is the cure, and I couldn't disagree more if he had written that statement on a shard of tin and jammed it in my stomach.

That is quite a strong disagreement.

I mean, didn't PHP break the web in the first place?

Right off the bat, I should note that I do believe PHP can be used well. Any language (almost) can be used properly enough that it can be a decent environment to use, so long as you follow strict rules. PHP is a great example of a language that promotes ignoring any rules. Following a good set of policies, one can develop well structured and elegant applications with PHP, but the fact of the matter is that the language does very little to promote anything in the way of good use of itself.

PHP might not promote bad coding, but it simply does so little in the way of promoting good code that it might as well provide facilities for plaintext passwords in query strings built in at the global level. There are too many aspiring developers finding their way to PHP, being drawn by the crowd, rather than the quality of the language. There is a critical mass of bad information about all the wrong ways we can do things in PHP, and none of them tell you its the wrong way. Are they evil? No, they just don't know any better either.

PHP is not evil. PHP broke the web with nothing but good intentions. PHP still broke the web, and only with a massively backwards-compatibility breaking (and that means no options to enable it back!) revisions to the language would anything be remedied. Even in that case, either everyone will migrate to other languages or the language would fork, because the only way to fix PHP is to become like Perl 6 and not exist at all.

I am beginning to sound like a language bigot.

Comments

Anonymous said…
beginning????


ah, that's ok. i think we all are language bigots anyway. but fighting php is like swimming upstream. unless you care to invent something better. why do you think php is so popular when so many other things are better? 1) it's fast and ubiquitious. 2) it's simple. 3) it has a powerful (in the sense of functionality, not necessarily in terms of quality) standard library
4) the user-annoted documentation REALLY helps, even though a lot of it is stupid or wrong. who cares -- you can solve your problem quickly and easily (albeit wrongly)

basically, php was available and easy. python might be the latter but it's not much of the former.

jamie
Anonymous said…
"something better" would be for many people to actually take programming classes and learn how programming is done.

php became popular because it allowed non-programmers access to a programming language.

php is not faster than related languages. it became ubiquitous only because it was accessible to non-programmers.

it is not simple but complex like any programming language. it is easy to embedd into html. but that is a problem in itself.

other languages have powerful libraries too.

yes, the documentation is good.but wrong things are dangerous. and non-programmers do not understand the problems they are creating.

anything better than php would be less easy for the non-programmer or less powerful.
Anonymous said…
and these better solutions exist.
other programming languages,
html templating systems.

they will just never be as popular, because php gets so much attention.

Popular posts from this blog

CARDIAC: The Cardboard Computer

I am just so excited about this. CARDIAC. The Cardboard Computer. How cool is that? This piece of history is amazing and better than that: it is extremely accessible. This fantastic design was built in 1969 by David Hagelbarger at Bell Labs to explain what computers were to those who would otherwise have no exposure to them. Miraculously, the CARDIAC (CARDboard Interactive Aid to Computation) was able to actually function as a slow and rudimentary computer.  One of the most fascinating aspects of this gem is that at the time of its publication the scope it was able to demonstrate was actually useful in explaining what a computer was. Could you imagine trying to explain computers today with anything close to the CARDIAC? It had 100 memory locations and only ten instructions. The memory held signed 3-digit numbers (-999 through 999) and instructions could be encoded such that the first digit was the instruction and the second two digits were the address of memory to operat...

Statement Functions

At a small suggestion in #python, I wrote up a simple module that allows the use of many python statements in places requiring statements. This post serves as the announcement and documentation. You can find the release here . The pattern is the statement's keyword appended with a single underscore, so the first, of course, is print_. The example writes 'some+text' to an IOString for a URL query string. This mostly follows what it seems the print function will be in py3k. print_("some", "text", outfile=query_iostring, sep="+", end="") An obvious second choice was to wrap if statements. They take a condition value, and expect a truth value or callback an an optional else value or callback. Values and callbacks are named if_true, cb_true, if_false, and cb_false. if_(raw_input("Continue?")=="Y", cb_true=play_game, cb_false=quit) Of course, often your else might be an error case, so raising an exception could be useful...

Announcing Feet, a Python Runner

I've been working on a problem that's bugged me for about as long as I've used Python and I want to announce my stab at a solution, finally! I've been working on the problem of "How do i get this little thing I made to my friend so they can try it out?" Python is great. Python is especially a great language to get started in, when you don't know a lot about software development, and probably don't even know a lot about computers in general. Yes, Python has a lot of options for tackling some of these distribution problems for games and apps. Py2EXE was an early option, PyInstaller is very popular now, and PyOxide is an interesting recent entry. These can be great options, but they didn't fit the kind of use case and experience that made sense to me. I'd never really been about to put my finger on it, until earlier this year: Python needs LÖVE . LÖVE, also known as "Love 2D", is a game engine that makes it super easy to build ...