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.
Very well written.
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.
Thanks for your comment, Neil.
I feel like I presented a fair argument for why someone should use TypeScript in 2023.
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.
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.
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?
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.
Typescript gona stay here for some time, This js vs typescript trend will be dropped when another hot topic arises.
Meanwhile PHP is dead 🤗.
Good read. You have legit writing talent!
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:
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 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
I completely agree with you Alex
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.
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.