DEV Community

Cover image for My Experience Learning TypeScript
Bridget Amana
Bridget Amana

Posted on • Edited on

My Experience Learning TypeScript

So, I had my fill of JavaScript and thought, "Why not torture myself with TypeScript?”. To get started, I dug into the official TypeScript documentation but later stumbled upon this gem of a tutorial: TypeScript Tutorial. A friend also recommended some YouTube videos too which I will link below, but I learn best by reading, so I didn’t really follow through with the YouTube videos my friend suggested. (I know, weird right?)

The First Challenge: HNG11 Task 3

The first place I decided to try out my TypeScript skills was the HNG11 Task 3. And let me tell you, I saw premium shege 🤌. I'd write some code, push it thinking all was well, and then boom—deployment failed.

I was confused. Why was this happening? I realized I kept forgetting to add type checkers to my code, most times I used .jsx instead of .tsx. It was frustrating at first, and to make things worse I had a deadline to meet.

The Turning Point

Despite these challenges, I started to see the beauty of TypeScript. Here's why it’s awesome:

  • Static Typing: TypeScript catches errors early, which saves you from a lot of runtime headaches.
  • Better Code Quality: Explicit type definitions make your code more readable and maintainable.
  • Easy Refactoring: Refactoring becomes safer because TypeScript catches type-related issues before they become a problem.

A Piece of Advice

From one learner to another, get your hands dirty as you are learning. Simply learning concepts will give you the confidence that you understand them, but putting them into practice is where true understanding happens. You will encounter situations that reveal gaps in your knowledge and force you to learn deeply.

Conclusion

Learning TypeScript was a game-changer for me. It improved my code quality and overall development skills. Moving forward, I’m definitely sticking with TypeScript for my projects. So, if you’re considering it, dive in. Yes, you’ll make mistakes, but that’s all part of the journey. Trust me, you won’t regret it.

Helpful Resources
Typescript Handbook
YouTube Video 1
YouTube Video 2

Hit the ❤️ If you enjoyed this post, and you can connect with me on LinkedIn and Twitter

Top comments (4)

Collapse
 
giovannimazzuoccolo profile image
Giovanni Mazzuoccolo • Edited

Using typescript is like driving with the GPS on. You still need to pay attention on the road (bugs) but you know where you are going and where you have to turn. And maybe it's not the fastest route, but it's the safer.

Collapse
 
imthedeveloper profile image
ImTheDeveloper

Agree with this sentiment. I forced myself to start a project with TS. I'm still not great with it but I feel the benefits.

Going back to an older js project and I do instantly feel the pain. I'm consistently moving around my code and double checking items are mapped up correctly.

Collapse
 
bridget_amana profile image
Bridget Amana

That's a great analogy! I definitely feel more confident navigating my code with TypeScript, even if it means taking a bit more time to ensure everything is typed correctly. The extra safety and clarity are worth it. Thanks for sharing this perspective!

Collapse
 
brense profile image
Rense Bakker

Its the road with less traffic jams (time wasted debugging runtime errors)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.