Typescript: Partial Migration, Book & Exam
For years, I worked exclusively with vanilla JavaScript—no React, no Vue, no Angular. I know about all of these frameworks, but I never had the opportunity to work with them. Angular, in particular, has bugged me because it has recently become the bread and butter of frontend development for full-stack developers. Angular is heavily dependent on TypeScript, so what better use of my free time and vacation than to dive into that?
I got my hands on what is basically the only viable TypeScript book in the German market: the O’Reilly release of Boris Cherny’s translation. Initially, I bought a book by an Indonesian author, but it was horribly written and poorly edited. I’m tolerant, but that was just too much; the level of care was nonexistent. How can some people even publish work of such low quality? I quit that book after 40 pages, refunded it, and got the O’Reilly one in used condition at a bargain price—and I think the book is definitely worth it. It’s very well-structured and covers not only the core language but also deployment, migration, and plenty of niche topics you barely need or use.
I read the book with great joy, and after a while, I decided to solidify my knowledge officially with a paid certification course by W3Schools alongside the book. I think it took me less than 20 hours for the course and exam, as I approached the latter with extensive knowledge from other strongly-typed languages like C#. C# has all this strongly-typed goodness built-in. I love C#, but that’s another story. I passed the 70-question exam easily with 90%+ and needed just over half an hour.
For my actual TypeScript use case in the WTF model, I basically need only Types—maybe also Interfaces, Generics, and Enums at some point—and, of course, the tsconfig.json setup. But that’s it. I’ve already augmented the project to serve settings.js and globals.js now as TypeScript, which then transpiles down to JavaScript. I think that’s OK for now. I tried migrating the entire codebase one evening in a forced effort, but it turned into a mess with all the imports/exports and the regular JS libraries that go along. I had also split the project into sub-configs that reference each other, and eventually, the cluster-fuck was complete- nothing worked. So, to cut it short, the complete migration of the WTF codebase to TypeScript will have to come at a later date—when I preferably have more experience with the language and compiler options in general.
However, I do believe that the project will benefit from strong typing in the long term. And if not, it’s been a worthwhile exercise in diligence and proper coding. That discipline and grind doesn’t hurt an old man like me; rather, it’s the opposite!