DEV Community

Discussion on: TypeScript is a waste of time. Change my mind.

Collapse
 
quanla profile image
Quan Le

So TS is always correct and never gives stupid errors? Even TS team doesnt believe so, that's why they have ts-ignore.

Sure, every newbie's code are swamped with simple mistakes, and simply fixing those typos can make the code "run". That gives you the immpression that the compiler is life saver here. And that is ahuge delusion

Thread Thread
 
yawaramin profile image
Yawar Amin

If you use it properly, it should be very rare to get a 'stupid' error. Almost every type error is saying something interesting, in my experience. ts-ignore is not something unique to TypeScript, every language provides escape hatches from their static checks. E.g. Rust's unsafe and Haskell's unsafePerformIO, etc.

Thread Thread
 
quanla profile image
Quan Le

First, why are you so sure that I am not using it properly? Is it that difficult to use a compiler "properly"?

Second, great. Thanks for the point. It helps explain why all static language is failing at a certain level.

Cheers

Thread Thread
 
yawaramin profile image
Yawar Amin

Is it that difficult to use a compiler "properly"?

Actually, it kinda is difficult. You have to put in some work to understand the type system, error messages, idioms, how to take maximum advantage of static types and their intersection with dynamic values. No such thing as a free lunch.

all static language is failing at a certain level.

Well here's the thing. Static languages have an escape hatch to allow dynamic behaviour. However dynamic languages don't have an 'escape hatch' to allow static behaviour. So really, by sticking to dynamic only, we are limiting ourselves.

Thread Thread
 
quanla profile image
Quan Le

Right. Thanks. With your reasoning even eating lunch is difficult, you have to learn which one you have to chew and which one you have to swallow immediately, and how to have both together for maximum eating joy...

Sorry for the sarcarsm, but man, using static type is just the easiest thing in programming ever.

Anyway, goodluck with programming

Thread Thread
 
yawaramin profile image
Yawar Amin

using static type is just the easiest thing in programming ever.

So it's really easy and it can be helpful ... I don't get it, in that case what's your argument against it?

Thread Thread
 
quanla profile image
Quan Le

Did I say it can be helpful? Maybe, for people who cant determine what type of variable he is looking at. But for me, and the author of this article, TS is doing more harm than good. And it is like a pain in the ass using TS every day

Thread Thread
 
yawaramin profile image
Yawar Amin

Ha ha, OK, best of luck to you as you are obviously a programming superstar who doesn't need any help from a typechecker.

Thread Thread
 
quanla profile image
Quan Le

Yeah, sorry if I sound like a jerk, but I had my years with static typing already. At first things are super nice, but then shortcomings start to appear, and now, it totally outweighed the good stuffs.

So yes, typechecking does help here and there, but the tradeoffs are far too big for me. So, no thanks