DEV Community

Discussion on: I hate Typescript, is it a shame?

Collapse
 
juanfrank77 profile image
Juan F Gonzalez

No, you're not the only that hates it. Many also do. It's been the "trendy" thing for a long while and people prefer it because "it has better tooling".

But wait and see, the TS era is coming to an end. When some proposals for JS make it to the official spec, TS will be just a memory.

And we will be able to go back to develop for the web using the original holy trio of web dev.

Collapse
 
eshimischi profile image
eshimischi

It won’t.. JS will never have what TS has because there is no intentions to make JS “strongly typed”..

Collapse
 
juanfrank77 profile image
Juan F Gonzalez

It doesn't need to be "strongly typed". That will pretty much destroy the language. But the "type annotations" proposal can help with that types ordeal.

Thread Thread
 
eshimischi profile image
eshimischi

Still won’t make JS any closer to what TS supposed to help to do.

Thread Thread
 
bytebricks profile image
ByteBricks.ai

Maybe

Collapse
 
gpapadopoulos profile image
George Papadopoulos

Most, if not all of those features come from and because of TS. Even now, you see them. For example, classes, or ahem...type annotations?
So eventually your beloved JS will become TS, just under a different name; will you hate JS then?

Collapse
 
bytebricks profile image
ByteBricks.ai

Amen to that 😍

Collapse
 
barrymichaeldoyle profile image
Barry Michael Doyle

Exactly that, if it does make it to the JS official spec then mission accomplished! But I think we're a while off from that. I absolutely hated it when we first started using it in our projects but now I can't imagine not using it unless it actually gets baked into JS.

Collapse
 
akeemkabiru profile image
Kabby

Until Javascript becomes statically typing

Collapse
 
tylim88 profile image
Acid Coder • Edited

nah, TS type level is another language on it own, TC 39 will not even come close to what TS can really do

In fact I would argue that TC 39 will further accelerate TS adoption because TC 39 exposes type system to JS developers, making them easier to accept TS once JS developers want more powerful type safe features

Collapse
 
radubrehar profile image
Radu Brehar👨‍💻

Well, TypeScript was written to make JS development better. If the JS spec succeeds in adding type annotations in a backward-compatible way, then TS will have reached its goal - mission accomplished.

But till that moment comes, I think there's still a VERY long way to go!

Collapse
 
desone profile image
Desone
Collapse
 
wraith profile image
Jake Lundberg

Would you be willing to elaborate on why you believe TS is "trendy"? Its been around for more than a decade (longer than ReactJS) and has dominant marketshare (according to the most recent State of JS). In the tech industry, something lasting more than 10 years is quite rare, so I'm curious to understand your thoughts.

Also, would you mind clarifying how upcoming proposals making TS "just a memory" shows that TS is bad? If TS has had such a positive impact on the industry that it's principles are being adopted by JS, wouldn't that indicate that TS is significantly good? Or am I looking at this incorrectly?

Collapse
 
overflow profile image
overFlow

its like someone stealing your shine!!!!
Its like when you get to realise that most of the hits of Elvis Presley were written by Black artists back in the oppressive days and they never got anything or any credit for them.

TS is like

JS looking prim and proper and getting the girl.

Thread Thread
 
bytebricks profile image
ByteBricks.ai

🤗🤗

Collapse
 
bytebricks profile image
ByteBricks.ai

it is Trendy !== Trending
Dont you see shaming for rejecting TS 😑?

Thread Thread
 
wraith profile image
Jake Lundberg

I think you might misunderstand me friend. There is no shaming going on. Poster made some statements, so I asked for more information and included some facts that don't seem to support those statements.

Collapse
 
desone profile image
Desone
Collapse
 
daelmaak profile image
Daniel Macák

I think you misunderstand what TS is about. People don't use it because it has "better tooling", they use it because TS brings responsibility and clarity to the codebase and it eliminates a whole class of errors thanks to static type checking.

Does it have tradeoffs? Absolutely. Are they worth it? You bet your money it is. If you don't like it, don't use it in your pet projects, but please do use it where quality and team communication matters.

Collapse
 
cmgustin profile image
Chris Gustin

Exactly this. I think the dislike arises when people think TS is some magic bullet that has to be used on every project, rather than a specific solution to a specific problem that may arise in certain code bases. In this case, I think TS shines in large, distributed code bases where a lot of different devs might need to be on the same page and the code needs to be crystal clear. In cases like that, static typing would be a huge asset. Or a dev who is coming to JavaScript from a static language like C or Java and wants to keep some of those language features, it could make the language more comfortable to work with.

But for a JavaScript hobbyist working on a pet project, or a junior dev who’s still trying to wrap their head around the fundamentals of JavaScript as a whole? Of course it’s going to feel like an extra layer of unnecessary frustration because in those cases, using TS is wholly unnecessary.

I think there’s too much pressure on younger devs in general to always learn the latest and greatest thing, often at the expense of mastering fundamentals. If you’re learning React but still struggle with JS or you’re learning Typescript but haven’t tried out a statically typed language, even just a little, you prob need to slow down and focus more on the fundamentals.

Anyway, thanks for coming to my TED talk.

Thread Thread
 
daelmaak profile image
Daniel Macák • Edited

I see where people who dislike it are coming from, but I think the argument is mainly emotional. "I don't like the look of types and they slow me down" I keep hearing, and I was like that in the past as well. But these people forget about the huge upside which I mentioned above.

I don't think one needs a big team with a huge codebase to make TS shine as you say. I'd even go as far as saying, that whenever there is any team of devs and their project is at least semi-serious, TS is a big asset worth the effort. Unless there is a strong argument against it, like we saw in the Svelte team dropping it for DX and delivery reasons. But those cases are rather rare and very individual in their reasoning.

But of course, pet projects, students, anyone who just wants to try out programming JS, TS can be an useless overhead for you, 100%.

Thread Thread
 
gene profile image
Gene

The way you put it, you're definitely saying TS is a must and a good practice.

I think if you really know what you're doing in JS, TS is just an extra.

Thread Thread
 
daelmaak profile image
Daniel Macák

I realized we never defined if JSDoc is used or not. If it is, I am kinda fine with that, but I'd still prefer TS for application development. I prefer it in lib dev as well, but I understand teams like Svelte dropping it and using JSDoc instead. If we talk not using any static type information, that's suitable only for smaller projects or those that don't have long term ambition imo.

Thread Thread
 
dsaga profile image
Dusan Petkovic

The use of typescript is definitely a must for me, when starting either small or large projects with small or large teams, I do it because I can't deal with dynamic typing anymore, it slows me down too much, maybe not initially but as you develop the codebase you need to keep more and more context into your mind (what is being received vs what is being returned) rather than having it be inferred by the compiler, which is soo much more helpful.

I don't think I would switch to JSDoc as an alternative as I have tried it, and approached it the same way, but it turned out to be very awkward and ugly, sort of out of place, even stopped working when I spun up the project after a while...

Thread Thread
 
juanfrank77 profile image
Juan F Gonzalez

That's fine. Opinions are like JS frameworks. There are too many of them and none is completely right or wrong.