My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Alex Kates

168 likes

·

1.4K reads

21 comments

Sandro Volpicella
Sandro Volpicella
Sep 8, 2023

Good one! I think one big difference is also if you build an application or a framework. I do understand that using TS in frameworks can get quite complicated.

I use one repository still in JS and it is so easy to miss basic things like missing imports, not available parameters, etc. I can't think of working only with JS again.

61
·
·2 replies
Alex Kates
Alex Kates
Author
·Sep 8, 2023

Same. I have some legacy JS repos as well, but I can't imagine starting a new project in 2023 without a Turborepo powered TS monorepo

21
·
CodingSplash
CodingSplash
Sep 10, 2023

Very well written.

10
·
Neil Douglas
Neil Douglas
Sep 18, 2023

No, you do not need Typescript. What you need, is a dictionary, that would enlighten you that the definition of "need" is "require (something) because it is essential or very important rather than just desirable.". You need oxygen to live. You don't need TypeScript to live a successful good life. Explicit typing is not necessary nor essential. C, Ruby, Perl, PHP - even PHP - live pretty well without explicit typing. Go tell Facebook that they need strong typing in their PHP, otherwise they won't be happy nor successful, they will make mistakes, and will suffer through all 9 circles of hell. Oh poor Facebook engineers. Yuck. Amazing how hard it is for some people to accept that their mantra might not be the One Universal Truth. Just deal with it. That's the only thing you really need to do in this case.

17
·
·4 replies
Alex Kates
Alex Kates
Author
·Sep 18, 2023

Thanks for your comment, Neil.

I feel like I presented a fair argument for why someone should use TypeScript in 2023.

Do you have an argument for why someone should pick JavaScript instead?

I only used the word "need" once in the summary, and I may edit that out because I don't want to be dogmatic about it. This has just been my experience.

·
Neil Douglas
Neil Douglas
Sep 19, 2023

Alex Kates my quarrel is not about typescript itself, rather about the way this information is being served. "You should do this, because alternatives suck! No, you should do that, because it's better, it's shinier, and it's CPU is 1.4% faster! You absolutely need this new car with automatic parking because you suck at parking, people scratch all the time when they park their cars, don't be like them, buy this new toy with auto parking, don't be like all those fools!". The whole article is one huge marketing preach, borderline religious. And there are very few things is this world that are worse that religious approach to things and believes.

Telling people what they should do or use, what they need or needn't, is bad manners.

You should use the tool that you're the most happy, most comfortable with. Not the most productive, mind you. Leave the "productive" mantra to Silicon people, who don't mind burning out their life, their work, their passion early in the career. You should work with the tool you're enjoying. Even if I hit that nil error with ruby once a year, it still makes me much more happier that Java would. Yes, Types are nice. But that does not matter, if they don't make you enjoy your work. Nothing matters, if you're displeased, unhappy, or straight out hate what you do.

And if some people are happy with JS over TS - awesome! "It would be nice if you'd check out this thing called TypeScript, it may make your life better because this and that. It doesn't mean you should use it. It doesn't mean you need it. But it may make your life easier, so check it out!"

That's - what my point is about.

·
Alex Kates
Alex Kates
Author
·Sep 19, 2023

Neil Douglas

I respectfully disagree. This isn't a religious take, but a practical guide for choosing between JavaScript and TypeScript in 2023.

It's a persuasive article, not just personal preference.

While "use the tool that makes you happy" sounds good, it's not practical in a professional setting with real financial stakes.

Why not write an article sharing your own perspective?

·
Neil Douglas
Neil Douglas
Sep 19, 2023

Alex Kates A guide provides the reader with description, pros, and cons, and leaves the question of choice to the reader.

Marketing pitch convinces the reader that he needs The Thing or that the reader should use The Thing.

This article is trying to convince the reader that he should use The Thing, because using the Alternative is just so much worse. All while being on the entirely one-sided prejudiced approach.

Thus I leave up to the reader to decide if this article is a "guide", or just a blunt marketing pitch of the Thing that Author happened like more than the Alternative, to which Author, along with many others, takes approach with religious-like zealotry.

10
·
Heby T Paul
Heby T Paul
Sep 10, 2023

Typescript gona stay here for some time, This js vs typescript trend will be dropped when another hot topic arises.

Meanwhile PHP is dead 🤗.

12
·
Jordan Brennan
Jordan Brennan
Sep 13, 2023

Good read. You have legit writing talent!

It's worth noting TS influencers (I hate that that's now a thing in the engineering world) who know nothing about Turbo were freaking out creating internet drama and trashing DHH all while not realizing removing TS changed nothing for the library's users - you don't interface with Turbo through JavaScript. Turbo API is HTML. Removing TS was strictly to make the maintainer's job easier.

Your article... These arguments in support of TS are nothing new and I'm not suggesting they're wrong or bad, but there's strong counter-arguments to these that are universally ignored by folks who feel a strong affinity toward TS. They are:

  • Yes, types already exist in JavaScript - let's use them! And create your own and use those too: if (color instanceof Color) setPaintBrush(color);

  • There are dozens of features built into JavaScript that developers are unfamiliar with and don't use because they have been taught you need TS to do those kinds of things

  • Tests are still 100% necessary. "But it compiled" is a bit of a joke even among strongly typed language communities like Java. It is a common misunderstanding of junior engineers that compiled = no bugs. TS hype reinforces this misunderstanding (not suggesting your article does that, but there's massive amounts of unbridled TS hype out there misleading developers)

  • Intellisense and autocomplete is as good and often better with JSDoc

  • I say better because all the TS projects I have worked on have no comments at all. Developers mistakenly assume typedefs and interfaces tell other developers everything they'll need to know. That's frequently not the case. In healthy codebases TS typedefs ironically have JSDoc comments to provide helpful and necessary information that TS can't, which is shown by intellisense

  • Intellisense and autocomplete is powered by the same ts engine built into the IDE so the developer experience with JSDoc is the same as TS - the UI in my IDE is identical between the two

  • You get type warnings with JSDoc too. Again, it's powered by the same ts engine built into the IDE

  • TS adds bloat to your app bundle

  • TS requires a build step and as such slows down your builds

  • TS requires ongoing configuration and updates, JSDoc requires nothing whatsoever - it's just vanilla JavaScript comments made magical by the IDE

  • TS makes zero guarantees about runtime safety, which is what really matters

  • TS can do nothing about more common bugs like CSS and logical errors

  • I tracked bugs for almost 3 years on a medium-sized app and out of 68 (I think that was the total) only 1 could have been prevented with TS

We need to stop getting emotionally attached to technology. I'm guilty of this too🫣 It's weakening the software engineering culture and it moves important objective facts off the table

12
·
Amrit Lokhande
Amrit Lokhande
Sep 10, 2023

Great Share

11
·
Shad Mirza
Shad Mirza
Sep 9, 2023

Well written. 100% agree with you on this.

10
·
·1 reply
Alex Kates
Alex Kates
Author
·Sep 9, 2023

Thanks Shad! Appreciate ya 🙏

10
·
Shreyas Chaliha
Shreyas Chaliha
Sep 9, 2023

I completely agree with you Alex

10
·
·1 reply
Alex Kates
Alex Kates
Author
·Sep 9, 2023

💯💯💯

12
·
Kavir Kaycee
Kavir Kaycee
Sep 14, 2023

Good take on the recent Twitter drama caused by DHH.

I think everyone should take their own decisions about what tech to use that serves their use case.

The whole thing of beef as marketing is something that's worked for DHH previously, so I guess that's what they do.

10
·
·1 reply
Alex Kates
Alex Kates
Author
·Sep 14, 2023

Yeaa I tried to stay objective and speak to my experience. Hopefully that comes through.

4
·
Alessandro
Alessandro
Oct 5, 2023

Although I understand the value of TypeScript (TS), JavaScript (JS) is native to the browsers and find it easier to debug than TypeScript. Does it matter? I think depends on the framework you are using. But understand... I despise both of them, just try to pick JS when I can, and if not end up using TS. For framework I do like using VueJS + Vuetify (you can build a nice web application quickly), not a huge fan of React.

10
·
raju ghorai
raju ghorai
Sep 20, 2023

TS

1
·
--
--
Sep 18, 2023

I am using typescript, and I regret for using it.

If you support typescript, that means you have not came to a point where typescript becomes pain and you begin to use ts-ignore comments yet

Types may be exist, but world is not perfect, every module has not been written in typescript.

Using TS looks as if it is trying to tame wild JS.

·
Md Taqui imam
Md Taqui imam
Sep 21, 2023

Thank you for the insightful blog post on TypeScript! I especially appreciate your emphasis on the rich developer experience and the ability to use one language across the entire stack. I'm definitely convinced that TypeScript is the way to go for modern JavaScript development.

·