Typescript was forced upon me!
... and I kinda liked it.
Matt ⋅ 9/6/2022
Happy Tuesday!
Well it happened to me. I didn't think it would, and I hadn't planned on it. Our team was so focused on a low-code javascript REST API rebuild, but we made some nre hires, and our project turned sharply left, and there we were, writing typescript and GraphQL queries!
I'm not a very cutting-edge guy, ...I am all about stability. My Linux distro of choice is Debian. My Node projects always run off the LTS version. I get nervous when ANY project I work on uses too many nmp packages. But the boss gets what the boss wants - or wanted, I should say. Our team has since gone in another direction, which is as story in itself.
Still, I was thrown into the deep end, as many TypeScripy rookies are. As we migrated a simple koa API to a cutting-edge express app with typescript report, graphQL queries, postGRES backup, and caching with Redis, I became familiar with writing and using types as well as taking advantage of the new operators provided.
how did I learn it?
No better way to learn it than to do it, I always say.
The task was to migrate our entire API, which supports web, mobile and rss, to the Express app our new lead built. The learning curve is considerable, but if you are familiar with JavaScript you should be writing workable code by the end of the day.
Of course it takes time to get comfortable with the details. Video tutorials have always helped me in the past. Thankfully the boss provides access to LinkedIn Learning, which has courses on TypeScript, JavaScript, Microsoft Powerpoint, Career Transitioning, and pretty much anything else you would want to know on the job.
If you do not have access, I've also used quality courses on Udemy, which is my goto for online learning. Classes are around $12, but then they are yours for life to refer to, bookmark, notate, and repeat.
I'm sure there are some good books as well.
What do I think of it?
Honestly, it's OK. It has its goods and bads.
I do like:
- using
import
in Node - how it links to imported modules
- how it finds bugs that I would not immediately find.
But I don't like:
- the extra setup
- the extra code
- the learning curve
Would I use it again?
Yes! I am actually planning to. I'm stuck on Gatsby3 currently, as upgrading past node v14
is already proving to be a chore. I realiuzed while working with the TypeScript API that I did appreciate TypeScript, once it was set up. It bridges the browser-centric HavaScript with the benefits of a "real" type-based programming language. I immediately noticed errors I would rely on QA to catch being picked up and oh-so-enatly logged in the console.
Setting it up, however, takes its own toll. Perhaps the sweat spent setting it up will provide a more enjouable development experience in the long run? I will soon find out.