Preface
My journey to TypeScript was not a direct or quick one. I started off in school primarily writing Java, then C++, and like many new developers raised on statically typed languages, I looked down on JavaScript as “just” the sloppy little scripting language people throw onto websites.
My first substantial project in the language was a silly remake of the original Super Mario Bros. video game in pure HTML5/CSS/JavaScript and, typical of many first projects, was an absolute mess. In the beginning of the project I instinctively disliked JavaScript’s weird flexibility and lack of guardrails. It was only toward the end that I really began to respect JavaScript’s features and quirks: its flexibility as a language, its ability to mix and match small functions, and its ability to just work in user browsers within seconds of page load.
By the time I finished that first project, I had fallen in love with JavaScript.
Static analysis (tools that analyze your code without running it) such as TypeScript also gave me a queasy gut feeling at first. JavaScript is so breezy and fluid, I thought, why bog ourselves down with rigid structures and types? Were we reverting back to the worlds of Java and C++ that I had left behind?
Coming back to my old projects, it took me all of 10 minutes of struggling to read through my old, convoluted JavaScript code to understand how messy things could get without static analysis. The act of cleaning that code up showed me all the places I would have benefited ...