Web Development revisited

So, I've been working a lot on HTML5 based web applications lately. And my feelings towards it are evolving. Perhaps the biggest reason is that I just recently accomplished something I feel could be classified as "advanced".


Whenever I tackle a new language, there is always a beginning period where I'm able to get basic things as long as I can find some similar code or examples to work from. Basically means I'd do OK in a support role or very lightweight customizations, but writing new projects would be totally out of the question. This stage is generally the stage where I feel the most angst towards whatever new language it is I'm learning. This is the "I'm perpetually frustrated" stage.


The next stage I usually go through is the one I'm at now. I'm so far from mastering the language that it isn't funny, but at this point I probably could rather easily whip up even a rather complex application from scratch with minimal scrounging the web for architectural answers or basic assistance. This is the most rewarding stage of learning. In this stage, I'm comfortable enough to try writing new things and pushing my own limits. Every day is a learning experience and almost every day is extremely positive. This is the stage where I generally gush on about a new language. I won't be doing that here, but more on that later.


After that is the plateau. At a certain point of poking and prodding you reach a point of proficiency where that language is just another tool in your arsenal. You haven't mastered it, but you could probably fool a goodly number of people into believing you have. This stage can last years.


And lastly, the stage where you've mastered the language. You never really know when you hit this stage, but one day you get asked to do something, it sounds fairly complex, you get it 99% functional, go out and look for helpful tips for the last 1% and realize there is almost nothing out there on even half of what you have already done and it will be a cold day in hell before you find someone who has already done the remaining 1%, you'll work it out on your own and realize... you've done it. You've reach that upper echelon. Probably the only time I ever felt that way was with C#/XAML. I've done some CRAZY things in that sphere, including many where the only doc is the Microsoft white pages.


So, how has the transition into the nice and cozy stage treated JavaScript? Not well. It isn't all the fault of JavaScript. Part of it is that I've learnt a lot of programming languages by this point in my life... and JavaScript doesn't really do anything better than any of them. In fact, in and of itself, JS does far, FAR less than any I've really dived into before. The "core" JavaScript is like .Net with just the System.* namespace and nothing else. JQuery is where the bulk of the action is. It is actually funny, if you read virtually any JS tutorial you'd think JQuery was actually part of JS, because even where they outline how/where to find JS libraries, virtually all of ignore JQuery assuming you already know how to do that, like it somehow requires different steps from leveraging other external libraries.


I'm not AS negative on it as I was. But there are still a world of nightmares out there. Of course, I'm coming to appreciate that JavaScript "applications" don't really, pragmatically mesh with either what JS is meant to do or what a traditional application is. The easiest way to prove this is to throw out one acronym; DOM. JavaScript, and thus by extension JQuery and every JS library is DOM. Document Object Model. Document. Your web "application" is a document. It is an XML file, or PDF on steroids. To make life more amusing, single page applications are all the hype... which really means trying to make a mass of screens be presented as a single document. It is a cluster-f**k of loading and unloading HTML, scripts, etc.... It is sheer insanity.


In many ways it is also, I guess, a natural evolution. JavaScript really got its start making web pages dynamic. Which eventually meant it was easier to make one page take on the functionality of multiple pages which eventually lead to entire web sites and even applications being just a single page. There is an elegance to it all. And there is a reason/practicality to it all. Consolidation. For all of the JS I've written, I've never seen a cookie for instance in my code. The entire application is technically one page. I don't need to pass cookies between pages, because there is never actually a page change. And people hate/distrust cookies and other mechanisms never really made it.


But the heart of the cookie problem is the heart of every other problem in web development. No one owns it. Standards are a joke. We don't even have a single completed application yet and I've heard at least 5 complaints from QA already about functionality that behaves differently from one browser to the next which has nothing to do with our code. Anyone who actually believes HTML in any form is a standard in smoking some mighty strong sh*t. Aside from JQuery and JS syntax... I'm fairly certain every other library I'm using will be outdated within 2-5 years. Why? Because that is how a standard-less ecosystem works. And I'd go look for example, but I don't. JavaScript frameworks ARE the example. They are example to end all examples.


All of that being said... if you can choose the frameworks that you want, and find versions that all play nice and stick with it... then I think you'll find that over time Web Development with JavaScript isn't any more painful than picking up any other new programming language. If you've used mature and proprietary languages before you'll find a lot more gaps you need to fill with 3rd party libraries for sure, but that also doubles as an upside... if you don't like the first one you find, you can probably find 100 more.


Like I said earlier on, JavaScript won't win any prizes from me. It doesn't do any that I haven't seen other languages do and it doesn't really do anything particularly better. But it isn't terrible. If TypeScript gets a better foot hold in the JS community it will also help. Not just from getting libraries written to support it, but if other IDE's can bake in support for the auto-complete functionality (most web devs don't use Visual Studio) it could make a tremendous difference. I'm not saying all JS projects need the object oriented, strongly typed paradigm that TS brings to the table. In fact, it doesn't make sense in the traditional places a document based scripting language would be used. But for web applications and large scale single page applications what TS has definitely would be useful.


Perhaps what MS needs to build out is a JS scraper that can at least build a TS definition file as a basic wrapper around an JS file.


But that is off topic.


Conclusion. I don't like JavaScript, but I no longer hate it. I may grow to like it, but I am skeptical that I will ever love it.

Comments

Popular Posts