DEV Community

Redas Jefisovas
Redas Jefisovas

Posted on

Things I thought I didn't need while learning web development (part 1)

TypeScript

You're finally building that dream app that's gonna make your portfolio really pop and get all the recruiters sliding into your LinkedIn DMs. JavaScript is finally clicking, and you no longer have to Google the command for starting a new React project with npm create @vite latest ...hold up...that's not right!

Of course, if you have run the correct version of the above command, you've seen the option to start the project with TypeScript. Maybe you opted in once, wrote some code, your editor started screaming at you - and you went right back to good old friendly vanilla JS. That's what I did too. But I think it was a mistake and I'm here to stop you from making the same one.

The misconception I had was thinking that TypeScript is just another library that a "real" developer can do without. It requires extra configuration, a build step, and the syntax feels weird and confusing. The code running in the browser is still just JavaScript anyway, so why bother?

That "screaming" your editor did? It wasn't just being mean, it was actually trying to save you from yourself. TypeScript will expose faulty logic and mistakes way before they get a chance to become nasty bugs at runtime. Beyond the bug prevention, the developer experience is just amazing! Being able to automatically resolve imports, instantly see a function's parameters, and get smooth autocomplete. Big oouf! Once you get used to that, regular JavaScript will feel like me trying to write this blog post without asking Gemini to "FIX THE WRITING AND MAKE NO MISTAKES!!"

After actually using TypeScript on a daily basis ever since I landed my first real job as a developer, I wish (and so do many others) that JavaScript was more like TypeScript all the time. There's plenty of articles and videos out there going through all of the benefits, so I won't try to list them all here. But the point I want to make is that when you eventually land that dream job. You're most likely going to be writing TypeScript, so just start now and you'll thank yourself later!

Top comments (11)

Collapse
 
junothreadborne profile image
Juno Threadborne

You're most likely going to be writing TypeScript

Eh.....

So there's a lot of nuance here that your 2 years of dev experience wouldn't have shown you yet.

Static typing, as a tool, is just that. One additional tool to choose. I've worked in and built systems that use a mix of TS and JS. In fact, most of them were a mix. Because different problems (even within a given project) require different sets of tools to solve.

For instance, I might write a React front-end in TS because React supports it pretty well. Meanwhile, I'd use vanilla JS for the Node scripts that run some of the dev experience. Then Flow right along side the TS for Relay-related aspects of the UI. (I haven't done that, but why not?)

...without asking Gemini to "FIX THE WRITING AND MAKE NO MISTAKES!!"

And hoo boy, do I hope that's a joke. 😂

Collapse
 
xwero profile image
david duymelinck

Static typing, as a tool, is just that.

Static typing is just one of the features Typescript has over Javascript.
The others i'm thinking of are; interfaces, generics, enums, namespaces.

You can have an approximation of it in Javascript, but it missed a solid foundation.

React front-end in TS because React supports it pretty well. Meanwhile, I'd use vanilla JS for the Node scripts

I would do it the other way around. Node can run Typescript, while React in the browser doesn't.

The main thing that bothers me is that the evolution of Javascript seems to be stalled because of Typescript. I would rather see runtime type hinting in Javascript than using Typescript. The biggest features I can think of are the async functions (ES2017) and the dynamic import (ES2020). But that are not changes that affect the way the code is structured.

I'm mostly using PHP and I have seen the same evolution from only dynamic typing to now where people opting in for strict typing, and all those other features that Typescript provides. Still no generics, but I'm not that bothered not being able to use that feature.
I have force myself not to use things like function parameter typing or output typing. Not only to let my IDE yell at me, but also having that assurance it will error early when the application runs.

Javascript always had that I-don't-want-to-use-it-plain factor. From the time backend developers let it generate, to having languages on top of it like coffeescript, typescript and many others.

Collapse
 
junothreadborne profile image
Juno Threadborne • Edited

dynamic import...But that are not changes that affect the way the code is structured.

I totally get where you're coming from, and I appreciate the thoughtful breakdown overall. That said, I would gently push back on this point. In practice, dynamic imports fundamentally change structure. Not just syntax, but architecture.

They allow for lazy-loading of modules, which shifts decisions about bundling, dependency graphs, and execution order. That affects how devs organize features (e.g., splitting by route, feature, or plugin), and makes things like microfrontend design or plugin-based systems way more feasible without the overhead of custom loaders.

So while it's not a new language-level structure like interfaces or enums, it absolutely influences real-world project structure at scale.

Thread Thread
 
xwero profile image
david duymelinck • Edited

I agree it changes the syntax and architecture.

The point I was trying to make is that there are no features that change the runtime robustness of the code. In Javascript you need to rely on third party libraries or custom code to have the robustness that languages with a (more) static type-system have.

It should be a big neon sign for the people who maintain Javascript that the most popular way to use it, is a language with type in the name.

Collapse
 
holoflash profile image
Redas Jefisovas

To be clear, I'm not trying to say that no one writes or uses vanilla JavaScript - but that you most likely will be using TypeScript if you get a job as a web developer, and you kinda proved my point:

I've worked in and built systems that use a mix of TS and JS.

The key take-away from my post is supposed to be that you should start learning TS sooner, because I wish that I did. :)
Do you disagree?

Collapse
 
junothreadborne profile image
Juno Threadborne

Oh, no, TS is still super popular; I'm just adding context. I interpreted "you will most likely use TS" as "you will likely use ONLY TS," which is my mistake.

Thread Thread
 
holoflash profile image
Redas Jefisovas

And I appreciate your comment! Also, it's my first time trying to write about these things and articulate my thoughts, so I'll definitely work on being a bit clearer next time.

Collapse
 
cyber8080 profile image
Cyber Safety Zone

Great post! 🎉 I really appreciated how you highlighted under-valued skills like embracing TypeScript early—definitely something I wish I’d done sooner too. Your perspective on learning stuff "you think you don’t need" really resonated. Looking forward to part 2!

Collapse
 
valeriavg profile image
Valeria

Hey, where's the rest of the article?! I got excited, started reading and then a cliffhanger XD
Welcome to Dev.to!

Collapse
 
holoflash profile image
Redas Jefisovas

Ain't nobody got the attention span to read more than that :P Plus, writing is hard.
Thank you!!!

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