Feb 5, 2022
Whaaat? Another app written in TypeScript? Not very original of me. I used to write React/React Native apps in plain Javascript, and thought I had no use for TypeScript, but I shamelessly admit that I am a convert (I even use TS for interviews, since I don't have to spend mental effort recalling the structure of some variable).
The primary reason I switched to TypeScript is that it's a real snitch. I remember I once had a global state that I needed to refactor. A lot of different components and utility functions referenced this global state, but now that the state's structure has changed! Updating how the state was used across the entire codebase was going to be a nightmare.
I eventually made the updates everywhere in the codebase, but the process was a game a hide-and-seek. It's no life to live where you have to do a full-text search on your own code to find references to variable a, b, c. When I made the switch to TypeScript, I realized that this refactor would've been easy since TypeScript would do the snooping-around-the-codebase for me and tell me exactly where I needed to update.
So I hear the buzzword "scale" a lot when people describe the benefit of TypeScript. I don't like that word because it's a platitude that most people tune out. But I learned a valuable lesson that TypeScript's ability to tattletale would be massively helpful when refactoring code.
Are you a TS convert, or still a skeptic? If you're looking to migrate a small-/medium-sized codebase to TypeScript, I'm going to make a post about how I did it.
Also, check out Bathtimer if you want to shorten your showers! https://www.bathtimer.com/