/ BLOG / WebDev languages suck

As quite a few of you know, I’m rather dissatisfied with web development languages as a whole. I’m now 20 and I’ve tried or used quite a lot of languages, over the years; some of which were specifically designed for webdev, such as PHP, and others that were not, C or brainfuck for instance. I no longer feel that there are any suitable web development languages. None take my fancy and something about using C, for what is often a simple task where scablility isn’t a concern, just feels a little dirty and C-snob-ish to me.

Every language has flaws; be it inconsistant API, strict whitespace rulings, poor or half hearted design decisions, or not actually being the best tool for the job. So could I do better? Most likely not.

The first thing I think I have to define is the fact that computer languages are just as much a product as the things you create with them. So why am I saying this? Often languages aren’t engineered properly, with lack of fore-thought and design goals. This leads to what can only be described as the "PHP-Syndrome". Once you have a clear goal, you need to strive for that goal and hit it with full force and no deviation. If you do this, you’ll have the Firefox of the web language community. If you don’t, you’ll end up being the bloated Mozilla Suite.

Unfortunately being the new kid on the block can be really difficult some times. You’re going to be picked on, and you certainly won’t be immediately popular, so how do you carve out a niche for yourself? After all everyone needs one? Absolutely not. Whilst it’s true a new angle can help to sell your product, being different for the sake of being different can be a big mistake. Depending on your market, compatibility familiarity maybe the key.

Having defined these points of interest, I wanted to come down to the meat (and two veg) of my article. Unfortunately I’ve found it to be rather difficult. Having never designed a language and neither having the time nor money to put towards some serious R&D I’m already introducing anti-patterns into my architecture and I’ve not even discussed it yet. I’ll battle on though.

The goals I intend for my ideal language to fulfill are fairly straight forward;

Most of those points are quite obvious, but I think I might have to explain the final point. By design HTTP was originally stateless, unfortunately this meant that building real applications was a royal pain in the arse; which is why we have things like cookies tacked onto the end of the HTTP specs. I understand this, but I also see that a hell of a lot of web apps want to be stateful, and rolling your own system can be irritating even if its purely a case of wrapping some arbitrary functions. I will add a caveat to this intelligence, and that is it must not be like RoR and do what it thinks I want to do.

Before I get too heavily involved in implementation and start ranting again, I’ll Segway neatly into synatx and semantics. Overall, in terms of general syntax I refuse to rock the boat and will stead fastly state that C-style is the One True Way™, with one exception; returning values from functions. Returning struct’s implies a memory layout which shouldn’t be applicable to a memory managed language, and so for this one reason I’ve got to go with Lua style of returning multiple values.

Data types can be a big one to handle in web applications. I personally really like having a clear set of datatypes which you can assign to variables, and dislike PHP’s half hearted attempts of "type hinting". I do agree with an additional void or automatic type for certain use-cases, such as user input, which you can later sanitise.

With regards to OOP support, I used to find it a god-send for larger projects. Unfortunately you often find it being abused by many all over the digital universe. This is either because the person using it doesn’t understand, or the language isn’t up to it. For this reason I believe that either it should be supported with good documentation and a method to stop over use of singleton’s, or not supported at all. For this reason I propose OOP support, with the proviso that we (that’s the royal "we") find some way to stop the madness.

So that rounds off a few of the sharp corners that irritate me about web languages. I know theres a hell of a lot more work and thought involved, and as such you should really view this as a chance to moan. There’s a lot of available languages out there, and I know that I’ve not tried them all yet, but it does make me wonder if there is that fabled webdev nirvana out there.