Tuesday, July 21, 2015

I'm Just Not A Fan Of TypeScript

You won't change my mind

Every so often I get bit by one of JavaScript's "features." It's nearly always an error that would either fail to compile or just be easy to debug if I was working in a language I'm more familiar with. I'm not a fan of this
language, and for the most part I try to limit my work with JavaScript to manipulating display. Recently, though, I've been taking the effort to try to become more friendly with the language. I'm writing a little Node JS REST service (ok, I admit it. Node is extremely cool). I'm implementing the service using TypeScript because I've got a professional need to become familiar with it, so why not? This is where I'm getting annoyed. TypeScript comes with some really cool features, some that make me very happy. Static typing, classes, interfaces, all good stuffs. The problem is that TypeScript transpiles directly to JavaScript. It's basically window dressing on top of JavaScript. In addition to all the good stuffs, JavaScript is still there. You can simply create a TypeScript file and write JavaScript in it. You can write a file that's some sort of bastard offspring of the unholy union of TypeScript and JavaScript. When searching online for solutions to odd problems I tend to find more answers stating "just do such and such in JavaScript" when there's actually a preferred TypeScript way of accomplishing the task.
Ok, I get the need. TypeScript provides features that will make large JavaScript systems easier to maintain, easier to debug, this is a good thing. We're also in a Web world driven by JavaScript. We can't simply bring in an alternate language with a different runtime and no browser support and expect it to gain much traction (even if those languages are much more elegant to use). I get it. Really, I do. This does not change the fact that I hate JavaScript, and the fact that TypeScript is basically a superset of JavaScript means that I don't have a great deal of love for it, either. You can preach the wonders of JavaScript all you like. You're not going to change my mind. Through sheer usage I will become quite good with JavaScript. Still, you won't change my mind. Please don't take this personally (JavaScript guys tend to get defensive when I go on these rants). I'm not knocking your abilities, I'm not ignoring the power of your language. I just don't like it.

Thank you, and good night.