If you're just starting your coding journey or looking to level up your skills, you might be wondering whether to learn JavaScript or TypeScript. J...
For further actions, you may consider blocking this person and/or reporting abuse
Typescript is not bad at the end but JSDoc is fare more versatile, compatible with TS, even use TS types from TS module, but can work without compiling. JSDoc vs TS
JSDoc can't enforce type checks like TS, without enforcing half of the team won't care.
Bigger the team - more benefits from Typescript.
I used to be a TS hater and advocated for JSDoc once.
JSDoc can also configure to force type check, without extra
// @ts-checkWith
tsc? No, thanks, JSDoc is for documentation, can put examples and links there.Can't put more or less complex types in JSDoc btw, generics for example, maybe on closure compiler only, debug types also harder.
JsDoc can’t replace TS and using it with TS is just great for big teams
JSDoc can use all complex type solution, even generic: (take look this npm module, written in JSDoc)[npmjs.com/package/jsdoc-duck]
Vanilla Javascript is much simpler yet efficient and if one has good programming skills and does coding properly, it's very fast. No need to typecast all variable.s in fact that's strength of JavaScript. Why to add layers on the language which is interpreted and then make it compiled language.
So you get less runtime errors... And yes, that happens a lot. People change function implementations all the time. If some function return type changes and your code that uses that function expects an object with a certain property to be returned and its suddenly not available anymore, you're dead.
Thats a very good point. TS is must have for such refactoring
Today only i was building a temporary server. Started with js and then realised i have keep types of functions parameters in check and altered the files to index.js to index.ts 😂😂😂
IMO, JavaScript's implicit nature is much easier to learn than TypeScripts explicit nature.
JavaScript's makes it easier for beginners to jump into coding without needing to understand types or deal with strict errors. Especially for smaller projects they are typically working on, TypeScript can feel like over engineering.
I personally stay away from TypeScript because I can write my own JavaScript, thank you. And because I'm cognizant that dynamic typing is not a crutch, but a super power.
This one's obvious. JavaScript's ability to inherently operates without requiring additional type annotations and configurations upfront, which can slow down prototyping.
Also, JavaScript can "Just get it working" quickly, running directly in browsers or environments like Node.js without a compile step like TypeScript requires.
Also, JavaScript's polymorphisms is seamless, built-in without needing to configuring overloads or generics. While TypeScript can do this with any or unions, it's a conscious choice rather than an automatic and natural behavior.
In a nutshell, JavaScript defaults to flexibility and makes it more natural to fit where dynamic behavior is a first-class requirement. Its superpower is the ability to keep things simple and dynamic and never enforce structures unless it is really necessary.
Thanks for the article.
I agree with your point about the "compile step" and the initial configuration challenges of TypeScript—I’ve spent a fair amount of time getting it right myself.
That said, I don’t see myself going back to JavaScript. TypeScript has saved me from countless bugs, especially those caused by simple typos. And when it comes to refactoring, TypeScript is a game-changer.
I do a lot of refactoring since I’m often the one maintaining the codebase in most of the projects I work on. With TypeScript, I can make sweeping changes confidently, knowing the type system will catch any mistakes.
For me, the upfront investment in setup and learning TypeScript pays off exponentially in the long run, especially for larger or long-lived projects.
I completely understand what you're thinking. Long term though, it's a Microsoft language. They will force you to upgrade some historically speaking.
lol so true
It's easy to forget that just because you are writing typescript it's just same old dodgy JavaScript at runetime with many many weird edgecases!
Not learning Javascript is like saying you are chef if you can make yourself breakfast.
Cant agree more
Great insights! I'm curious, is it worth starting with TypeScript for a small project, or should I stick to JavaScript until I build something bigger?
Best way to learn is by applying it.
I use to hate TS, now I can't imagine going back to JS again. I recommend to start with TS right away.
Feeling is mutual
definetly, start small for better trackability
I thought JS doesn't require semicolons?
Semicolon is needed, just most of the times JS can correctly assume it's location, but not always.
Oh this is new to me. I will keep this in mind
Thats an optional thing. it works with and without it. I prefer facing without semis
TypeScript definitely feels like a superpower after reading this! The gradual learning curve you mentioned is such a relief for beginners like me
Happy that article helped with yo TS journey
How long do you think it takes to get comfortable with advanced TypeScript features like generics or utility types?
For me it took an 6 months window or learning and making, more you build better you get
You’ve explained why TypeScript is such a game-changer
hey thanks
The resources you listed for learning TypeScript are gold! Thanks for not just explaining the 'why' but also giving us the 'how' to get started
Happy that they helped
Typescript FTW in JS world since people are writing such a sh*tty code its ridiculous.
We all start from JS. But yeah I cant imagine myself writing code without TS. Code auto complete and lint as big help avoiding ridiculous typos can make you waste 2 whole days.
Typescript with deno is also good start where you can just start using typescript without worrying about anything.
Actually that’s a thought. I haven’t tried deno but i should now
You mentioned Chakra UI and its TypeScript support—do you think it’s better for beginners than other UI frameworks?
I definitely think that