Just My Type: My Thoughts On Learning Typescript

05 Sep 2024

About a whole academic year ago, I took my first dive into C/C++ in my ICS 212 course, learning about pointers, ways to manage memory, and above all else, its strict type definitions.

You could imagine my relief when I first opened that Intro to Typescript assignment and found the sweet surprise of a language that can infer types.

First Impressions

Being introduced to Typescript this semester felt like a refresher to what I had previously learned, but with a gentler grasp on my mental wellbeing.

While Typescript brought out many principles I had to learn with C/C++, it immediately struck me as a language deliberately designed for the developer’s experience.

Manual vs. Automatic (i really like cars)

The main difference between the two lies within their ability to balance control and flexibility. I like to think of it in terms of driving an automatic versus a manual transmission car.

C/C++ comes at no surprise as the manual transmission, where you, the developer, are in full control over type declarations and memory, and thus are responsible for the many bugs that may occur from those operations.

Typescript takes on the smooth, more comfortable automatic transmission—with its ability to infer types and catch any mismatched typing errors before the code even runs.

This is not to say that you cannot apply strict types, as some automatic cars have the option to manually change gears, you also have the ability to bypass these inferences, and run a more dynamic program whenever desired.

So What?

With Typescript, you notice just how much more fluid and efficient coding can be, since you worry not about the low level operation details, and instead focus more on the logic of the actual program.

Comparing the painstaking debugging processes, Typescript’s edge makes the coding experience just that much more bearable.

As of writing this, I am currently in ICS 314, which revolves around an athletic style of software engineering. One of its most emphasized assignments, apart from projects, are WOD’s (Workout Of the Day). These time-limited problems are great at showing language fluidity and logical problem solving skills, and in combination with Typescript, allow for a greater focus on exactly those aspects of coding.

I personally enjoy the challenge, and think of it as more like that of a Kahoot.it game than a pop quiz. With that, I look forward to both honing my logical thinking skills using this program in this course, and as an added bonus, spare my parents from my endless debugging at 2 in the morning. (At least for this semester).