I’m currently suffering something of a dilemma as regards choice of programming language for website development. For those of you who aren’t of a particularly geeky bent, this is probably going to seem incredibly tedious, so you probably want to skip on this entry. I suspect, however, that there aren’t many non-geeks reading my blog, so here goes. Ok, so the situation is as follows (you probably already know this, but it bumps up my word count and makes me seem intelligent):
Practically, however, many languages just aren’t suitable or useful for spitting out web pages – for example, having an arbitrary C process sitting around on your web server will probably end up having a memory leak, or performing a fandango on core, with rather horrible results. On the other end of the spectrum, something as strange as ML, Haskell or LISP just isn’t very well suited to producing a web page.
So what does that leave?
Well, it pretty much leaves (in rough order of hackishness) Perl, PHP, Python, JSP, and “this .NET lark”. These languages, however, all seem to have certain flaws:
- Perl is compact and quick, but the code is tricky to understand and mistakes are easy to make. I’ve never really used Perl to any great extent, but I feel it suffers from the “quick and dirty” attitude it inherits from being primarily a Unix scripting language.
- PHP code is easier to understand, but anything you might want in terms of type safety (PHP is dynamically typed) or modularity and code re-use (PHP is only just getting towards a proper implementation of classes) is straight out of the window. It’s good for smallish sites, but for any larger projects (I would probably include WordPress as a larger project) it can get distinctly unpleasant. The myriad articles online suggest that perhaps something’s wrong, as does the sheer number of times I’ve mistyped a variable name or forgotten to add brackets after a method invocation, whereupon PHP will “helpfully” create said variable and instantiate it to zero. This is Not Good.
- Python I have never used myself, but it apparently has some rather nice properties in terms of type safety, object orientation and the like – I fully intend to look into this, especially as my current host provides support for it. I’m sure those who use it will be able to sing its praises, as well as lament whatever faults it has.
- JSP was Sun’s attempt to get Java into the website market. While Java is rather nice in terms of object-orientation, high-level abstractions and strong typing. However, it’s never really caught on to any great extent – whether this is due to market forces or because it’s crap, I don’t honestly know.
- Development based on Microsoft’s .NET platform has only recently come into play. From what I’ve been told from friends who use it at work, the backend tends to be written in C# and acts very much like a Java application (as we all know, C# is essentially Microsoft’s attempt to kill Java). While this gives us various nice properties, the killer problem here is that the only officially supported web server with which it is all compatible is Microsoft’s IIS. Which only runs on Microsoft’s Windows. Which just isn’t as good for servers as Apache on Unix, in this ranter’s view. The Mono Project may help in this area, but that seems still to be very much in development, and not server-worthy as yet.
From this hideously long ramble, I draw four conclusions:
- All languages have their faults, but PHP has more than its fair share.
- There is no single ‘best language’ out there, although zealots of all kinds will no doubt disagree with me on this.
- I could do with learning Python and seeing what it does.
- I’m way too picky.
Until next time.