Skip to navigation

malevolent design weblog

This blog is now defunct, but you can find more stuff over at my personal site

The Uncomfortable Truth About PHP

I use PHP for most of my server-side coding, but I can’t honestly say that I love it as a language. For me, its appeal is largely based on ubiquity, compatibility and cost; the vestigial oddities, mess of functions and slightly iffy syntax are tolerable.

When you look at where PHP works well as a language, and start thinking about how the less effective areas could be improved, you end up with some uncomfortable conclusions. Take out the messy bits, keep the simplicity, sharpen up some of the syntax, and… er… you realise that PHP could simply be replaced with JavaScript/ECMAScript. Let’s be honest and admit that someone has already got near to where PHP is heading, with the huge added bonus of consistency with client-side scripting.

Server-side JavaScript has been available in various forms for years, but no one is promoting a free, modern, well-supported, easy-to-install PHP competitor. If Adobe could bear to admit that ColdFusion is less than compelling then it’d make sense for them to extend their AIR and Tamarin work to the server to woo developers, but I’m not holding my breath.


Use the same language syntax and basic functionality on both the client and server? Heresy!

Michael Long, 4th Jul, 8:28pm

I'm all for it. JS is a wonderful language when you get past the fact that web browser implementations and the HTML DOM are the real problems. I've been doing a lot of PHP programming lately and though it works, its never "fun" to use. If you consider lambdas, first class functions, and prototypes fun.

— Greg, 4th Jul, 9:04pm

I've been looking into this:

Lonnie Lee Best, 5th Jul, 8:45am

While Lasso is not "free", it is my language of choice. MacTech has a comparison article.…

— Shelane, 9th Jul, 5:18pm

BullShit!!!! Mega-Bullshit,
"PHP could simply be replaced with JavaScript/ECMAScript" or with c++ or ASM or Turing machine... why not?

— drn74, 9th Jul, 5:32pm

Comments are now closed for this entry.