Oh, ho ho ha ha haaaaaaaaaaah… The gag never gets less funny. I need to be clear that Scott Hanselman is one of my favourite people in the public eye. I hold him to be an industry treasure and I’m fully aware of him just poking fun here but we’ve all seen this dialog before and we all know it is not always so lighthearted.
Patient: “Doctor, it hurts when I do this”
Doctor: “Well, don’t do it”
What’s The Damage?
Moving on to the issue that prompted me to start writing this article; WebAssembly is here. It has a great website explaining all about it: webassembly.org. It even has a logo! It also has a bunch of shiny new features that promise to improve the experience of end users browsing the web.
Where my real concern lies is in the well known problems that are brought about by having too much choice when it comes to communicating. We use human readable programming languages so that we can communicate our programs to each other. With that in mind it is clearly more effective in the long run if we all learn to talk the same language. The story of The Tower of Babel shows us that for a long time we have considered too much choice to be a very bad thing when it comes to communication.
Sorry if I missed this but … The issue is ‘too much choice’ in my opinion; but too much choice in regards to the flexibility of JS.
The flexibility of the language is a hard pill to swallow if you’re a C#, typed language programmer, and may be the source of contention.
Running into what Scott H. posted in the twitter post depicted above is a confusing matter, and potential for an mistake. This confusing matter can be remedied with studying, and experience; but it’s considered ‘wrong’ because it leads to confusion, and because you do have so many options.
There are some people that will have no issue learning JS, especially if that’s their first language. However going from C# to JS you have too many options, and this opens the door for quality issues, and learning roadblocks.
Typescript provides (maybe coffee script too) provide a mechanism for reducing options with compile time errors. This provide a safety net, and one less thing to worry about.
In my opinion, based on the endless debates on this matter, it seems that JS’s ‘cons’ come from people with less time on their hands, not from ignorance. JS’s flexibility allows for too many outcomes, which I think easily equates to more time no matter the benefits the flexibility gives.
There are endless popular frameworks that make JS easier to maintain, and write. This is a good indicator that there’s a common consensus that it is harder to maintain, and write.
I enjoy JS; but I didn’t enjoy it until JQuery came along. I’m loving all the great frameworks that make it easier to understand, and use. When I first used it, JS was introduced as a utility language. A language that you used to manipulate DOM elements. It wasn’t until years later, that I learned it as a language. I think it’s done/doing a lot of great things; but I don’t think we should have just ignored the ‘cons’, and focused on the flexibility ‘pro’.