Wednesday, October 30, 2013

I Miss Compiled Server-side Code

Clearly, we should accept the things we cannot change, but sometimes it's fun to rant for the sake of ranting. This week I was working on a web application using AngularJS/AJAX and it reminded me that I really miss relying on server-side code. I know it's not in vogue, but I'll say it... I liked web development before JavaScript took over as such a heavy part of the code base. Writing this post, I do feel a bit like an old man talking about the "good 'ol days," but I also feel strongly that there must be developers out there suffering under the new fashion of client-side code. (And don't even get me started on running 'scripting' languages server-side. :)

I get the 'why'--I really do. I understand that the IT world is moving to the cloud and web applications heavily lean on script-based client-side frameworks to allow for a powerful user experience across platforms including mobile devices such as phones and tablets. (I also get that the V8 JavaScript VM used in Chrome doesn't include an interpreter--that's just splitting hairs.) Yes, I understand all that and it's great.

The problem is the dev experience. I've been using Sublime and I tried out the web tools in Visual Studio 2013 and they have made some progress to better support JavaScript and client-side frameworks, but the experience is just not as good as the good 'ol days of writing compiled server controls. Client-side code is more fragile because the compiler often won't help you find all sorts of errors. Writing "myvariable" instead of "myVariable" can break your whole application and you likely won't know it until you try to run that piece of code. When debugging issues, there are cases where it's necessary to pull out a tool such as Fiddler which allows you to manually inspect the communication between the client and server. I'm not knocking Fiddler, it's a fantastic asset, but seriously, manually reading JSON to figure out why it's malformed? (Not that I would ever do that.) We may as well be back in the 90s writing VBScript.

To be clear, I'm not some sort of code snob. Code is code and devs should be judged on code quality, not what the language they happen to be using. So I'm not saying that Java, C# or Go is in some way better than JavaScript; that's not my point at all. I'm simply saying that my experience writing code was more enjoyable when I could rely on some well refined tools to improve my productivity.

What's the solution to all this? We clearly need dev tools good enough that the difference between server-side and client-side code is irrelevant. In my mind, the various JavaScript frameworks have improved the situation, but there's lots of room for improvement. Client-side code (or server-side scripts such as Node.js) will be around for a long time and it should be treated as first class.