DEV Community

Cover image for This is why I hate Typescript

This is why I hate Typescript

Michael De Abreu on July 19, 2019

This a satire post about some arguments that you can actually find against Typescript. Through most of them are being exaggerated, they all repres...
Collapse
ย 
adam_cyclones profile image
Adam Crockett ๐ŸŒ€ โ€ข โ€ข Edited

... where do I start. Let's do classes first. JavaScript class field syntax will in the coming months do exactly what typescript does, no more constructors or super.

Next modules, Microsoft are not phycic, Typescript docs actively discourage the use of namespaces, it is also very hard to deprecate something that legacy systems may rely on.

I could go on but I don't think I will get through (assuming your not trolling), your post may be illinformed.

If you think I'm a regular typescript user, I am not anymore. Mainly because JavaScript will be catching up with the proposals that both Babel and typescript implement. ๐Ÿ˜˜

Edit: based on the comment bellow I should probably read the whole damn post.

Edit edit, thank god this is a joke, I have never met anyone complain about typescript mostly because the only people I know who talk about it have used it, mostly everyone else is at-least curious. I don't think this post will help the junior developer to be honest and could be really damaging. You should try as many languages (supersets) as you can, understand want sucks and the wtf's.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

There are several articles out there pointing right at the core of the post. So, the argument is actually an extrapolation of true thoughts. :P.

Collapse
ย 
adam_cyclones profile image
Adam Crockett ๐ŸŒ€ โ€ข

I was like... Hmm bring it ๐ŸฅŠ๐Ÿ””. I should not drunk comment ๐Ÿคฃ, I even made a rage post inspired by my annoyance. Sorry Micheal ๐Ÿ˜†

Thread Thread
ย 
michaeljota profile image
Michael De Abreu โ€ข

This was the post I write inspired by my annoyance. Glad you like it.

Collapse
ย 
desone profile image
Desone โ€ข

Read this article and you will know why typescript is taking over:

medium.com/me/stats/post/85c30a370ef5

Collapse
ย 
orekav profile image
Orekav โ€ข

Typescript produce .js and .mal
You can use Chrome debugger reading that without any problem.

The factorial function you have posted is a lie, because you could set tsconfig.jsom to allow implicit any.

Angular? Nodejs and React (.tsx) can use typescript too

This post is Garbage

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

Why did you stop reading?

Collapse
ย 
cubiclebuddha profile image
Cubicle Buddha โ€ข โ€ข Edited

If you have to say that itโ€™s satire, then itโ€™s not good satire. The article is more damaging than helpful. If you like TypeScript then I canโ€™t see why you would want to write an article like this that TS-dissenters will likely be reblogging to further their cause. This is due to the fact that most of the people who donโ€™t like TypeScript havenโ€™t actually tried it. And this article just proves their confirmation biases. Instead we should be clarifying why TypeScript makes many of us so happy.

Thread Thread
ย 
michaeljota profile image
Michael De Abreu โ€ข

Yes. That's the intention. People should learn to use something before they have an opinion on it. But most of the time they don't. They just read the title an make assumptions.

PS: if you another comments, there are plenty of hints about this being a satire post. You could also open the links for a few more. :P.

Thread Thread
ย 
avatsaev profile image
Aslan Vatsaev โ€ข

You're not getting it, if you want to write a good article about TypeScript, then just do so and be straight forward, instead of trying to "teach your readers a lesson about life" (and badly so), nobody wants to play your games and sit there in confusion trying to understand if you're being serious or not while reading your garbage of an article.

Be straight forward, people will appreciate you more...

Collapse
ย 
orekav profile image
Orekav โ€ข

The examples are wrong.
Debug: lie
Just Angular: lie
Not compiling .js: LIE!!

Collapse
ย 
emh333 profile image
Ethan Hampton โ€ข

It took me way too long to understand the actual intent of the article. Well done๐Ÿ˜‚

Collapse
ย 
desone profile image
Desone โ€ข

Read this article and you will know why typescript is taking over:

medium.com/me/stats/post/85c30a370ef5

Collapse
ย 
jipingwang profile image
Jay โ€ข โ€ข Edited

Disagree all the points.

Modules:

TypeScript is a super set of JavaScript, you use TS syntax in design-time and tsc to JavaScript code for runtime. (Just like most people us JS2015+ in design-time, babel to JS5 for runtime)

Classes

  • the TS class is just like ES6+ class;
  • the JavaScript code is not a ES6+ class, but a ES5 function extending its prototype.

Private properties

today's status: "Public and private field declarations are an experimental feature (stage 3) proposed at TC39".
ES2 (1998) defined the reserved words: class, private, public, etc.
TypeScript uses "private" in class was a natural move.(unfortunately, not same as the es2019). But no break changes for TS developers, you don't hear them cry.

Typescript is not JavaScript

Of course you have errors for the factorial function (if using default tsconfig), that's the most important job TS does -- static type-checking.

The creator of Typescript knows nothing about programming

No comment. ( subjective topic)

People only use Typescript because they are used to OO languages

Not exactly, most of TypeScript (Object Oriented) features are being added to JS.
People use TS mainly because its static type-checking feature.

You can't debug Typescript

Why! I debugged TS in my first TS project.

Babel is so much better

overlapped in code trans-pile, but different others
Babel transforms JS code (high version to low version)
Babel uses TS (plugin) to transforms TS code
Babel uses Flow to transform Flow code

Typescript is only used in Angular

Yes, Angular is only framework forces application users to use TS syntax;
(you can use Angular UMD package in JavaScript, not popular usage)

Flow is better

Subjective. Flow is not standard JS either, it still needs to be transpiled.
Difference Flow vs TS, flow marks inline, but TS marks the extension.

You shouldn't use Typescript

my personal opinion:

  • use JavaScript, if you are application developers.
  • use TypeScript, if you are framework/library/package developers. (when building, deliver cms, ems, umd, whatever to your application users, just like Google material-ui team, VUI, AirBnb, firebase etc.)

my comment about TypeScript

pros: improve JavaScript code robustness, productivity (for experienced)
cons: learning curve high.
remember: TS is for static syntax type checking.

check this really big team experience sharing
youtube.com/watch?v=P-J9Eg7hJwE

Collapse
ย 
samjakob profile image
Sam (NBTX) โ€ข

It's satire. (I don't really get it though)

Collapse
ย 
avatsaev profile image
Aslan Vatsaev โ€ข

It's satire

a bad one

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

I will write property about ts. Hope you like that as well.

Collapse
ย 
tchaflich profile image
Thomas C. Haflich โ€ข โ€ข Edited

I dunno, I figured out it was a joke right at the beginning:

Typescript is just a big amount of garbage on top of the most wonderful language on ever created, JavaScript, [...]

Not sure I've met any JS developer who would write that down seriously!

I don't actually write any TS though so I have no opinions on the rest of the article's quality of humor ยฏ\_(ใƒ„)_/ยฏ

Collapse
ย 
pungiish profile image
Jan โ€ข

Yeah, that statement gave it out for me ๐Ÿ˜

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

Yeah... That should give you a hint...

Collapse
ย 
frostbyte profile image
Brian Bradshaw โ€ข

Well, if you had used TypeScript, I might have had a hint... ๐Ÿ˜‰

Collapse
ย 
guitarino profile image
Kirill Shestakov โ€ข

Sneaky! I was about to get angry, but then I read about the creator and it became too obvious :)

Collapse
ย 
theodesp profile image
Theofanis Despoudis โ€ข

That happens when you only read headlines...

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

My bad. Bio updated.

Collapse
ย 
mattmogford profile image
Matt โ€ข

Is this a joke?

Collapse
ย 
samjakob profile image
Sam (NBTX) โ€ข

Yes but I don't get it either lol

Collapse
ย 
mattmogford profile image
Matt โ€ข

It went on a bit so I didn't read it all.
Used typescript a few years ago. Getting back into it with React Native now.
Love it!

Thread Thread
ย 
samjakob profile image
Sam (NBTX) โ€ข

Yeah I skipped to the end because I was fairly sure. I'm using TypeScript for a project now and it's really neat.

Thread Thread
ย 
jckuhl profile image
Jonathan Kuhl โ€ข โ€ข Edited

Typescript is my favorite. All the fun of JavaScript, the type safety of Java and little to none of the biggest issues those two languages have on their own.

Itโ€™s only a PITA to get type definitions for 3rd party js libraries

Thread Thread
ย 
michaeljota profile image
Michael De Abreu โ€ข

You have to notice that you will never have the type safety of Java or C#. Those use an entire different method for type safe and they check on run time.

TS will check as far as it can, and would do it only in build time.

I think this is really important.

Collapse
ย 
stilllife00 profile image
Mirko Guarnier โ€ข

Smart. Maybe you should update your description where you say you like typescript to follow the same logic :)

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

Forgot about it! Thanks! :)

Collapse
ย 
ddonprogramming profile image
Decebal Dobrica โ€ข

Omg, I am not even sure you are even a programmer, if you were you'd know there are worst things than typescript like go-lang or reasonml or that little language that has errors horrifically done, elm I think it's called.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

I am really sure you didn't read the whole thing. :P.

Collapse
ย 
ddonprogramming profile image
Decebal Dobrica โ€ข

Or maybe I read too much and just proved everyone's point

Collapse
ย 
avatsaev profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Aslan Vatsaev โ€ข

I did. And the only thing I got from it is that you're bad at writing...

Thread Thread
ย 
michaeltharrington profile image
Michael Tharrington โ€ข

Hey there!

Lay off a bit.

It's totally okay that you didn't enjoy the article or the author's approach, but so many comments in one thread to tell them this is a bit excessive.

And no need for personal insults.

Collapse
ย 
mveroukis profile image
Mike โ€ข โ€ข Edited

Anyone who thinks javascript is the most beautiful language ever has mental issues. And Typescript is a stupid bag of garbage and I don't even really consider it a real language. They both suck monkey balls.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

Welcome! :)

Collapse
ย 
yuriitaran profile image
Yurii Taran โ€ข

It seems like you were forced to work with JS/TS and it was a real pain. Such a regret! Sorry to hear that. Many thanks for sharing your experience! It's very important that everyone had known that.

Collapse
ย 
beggars profile image
Dwayne Charrington โ€ข

Well played, Michael. I was sharpening up my pitchfork as I was reading this. And then I realised that you got me. Bravo!

The next step we need to make happen is first class TypeScript support in browsers, embed the compiler right into the browser and let us ship TS code.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

I would like that as well. But sure TS should enter a standardized process.

Collapse
ย 
janpauldahlke profile image
jan paul โ€ข

interesting though, although i like some features of ts. mainly the null or undefined checker. this forces you to code more precise and prevent undefined error, which, as you might know, is by far the most common and ugly to debug kind of js error.

Collapse
ย 
juancarlospaco profile image
Juan Carlos โ€ข

I totally understand what you say, but yeah expect a lot of Trolling back,
new waves of developers seems increasingly deceived by Marketing of new frameworks.

TypeScript types suck overall,
but for people that never really learn strong inferred static types, they do look like an improvement.

Collapse
ย 
mkenzo_8 profile image
mkenzo_8 โ€ข

xDD

meme

Collapse
ย 
dance2die profile image
Sung M. Kim โ€ข โ€ข Edited

touchรฉ, my friend, touchรฉ...

Collapse
ย 
werner profile image
Werner Echezurรญa โ€ข

Lol, I was about to start complaining about this ridiculous post until I read: this is a satiric post.

Just the fact you said Anders Hejlsberg was a bad programmer should be a tip of what you were saying.

Congratulations!, you made me go from anger to laugh in a very short amount of time.

Collapse
ย 
voronar profile image
Kirill Alexander Khalitov โ€ข โ€ข Edited

"People only use Typescript because they are used to OO languages"
TypeScript has cool functional features like sum types and discriminated unions whose makes code more expressive and easy to read.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

I think that's the section you should read carefully.

Collapse
ย 
alexmorleyfinch profile image
Alex โ€ข

I get that you're taking the piss, and that's all this is. A laugh. Nobody would seriously use this as an example to compare TS to JS. None of these points are valid, but yeah, let's all laugh at the Typescript noobs that don't actually know what they're talking about. Ahhh, the good life...

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

Hate Typescript. Sorry to disappoint you, but as I said, most of this points (if not all of them) are actually the point of view of one or more people who really think ts is bad.

Collapse
ย 
brandondtran profile image
Brandon D. Tran โ€ข

Please please please take this article down. Idiots will not read all the way through and not realize this is satire. It's going to make people's lives unnecessarily more difficult.

Collapse
ย 
brandondtran profile image
Brandon D. Tran โ€ข

Or at least put the satire warning at the top not the end.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

By petition I'll. But in a couple of days. Let's hope no one confuse this and think is for real.

Thread Thread
ย 
cubiclebuddha profile image
Cubicle Buddha โ€ข

You can see by the comment about Haskell and buying VSCode that people are already thinking this is real. And those who donโ€™t are still using it as an opportunity to trash TS.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

What you didn't like?

Collapse
ย 
akashkava profile image
Akash Kava โ€ข

What is there to like?

Thread Thread
ย 
michaeljota profile image
Michael De Abreu โ€ข

I don't think I can tell you what you can like. But I can learn if you tell me what you didn't like. :)

Collapse
ย 
jillesvangurp profile image
Jilles van Gurp โ€ข

Well played :-). I always say Typescript is a gateway drug for people who actually believe Javascript is a good or effective language. IMHO this is just a form of Stockholm syndrome.

As it preserves most of the madness that is Javascript for compatibility reasons, Typescript necessarily is a very messy, clumsy, and inconsistent language that allows for all sorts of very ugly hacks that have no place in a modern code base. Luckily, other languages are available and coming to a browser near you very soon thanks to WASM. Kotlin, Swift, C#, Ruby, Go, Elixir, Clojure, Python, Rust, C/C++, etc. All of them have WASM on their roadmaps directly or indirectly (by utilizing e.g. LLVM). Many of these are making this explicit. E.g. Rust is all about wasm this year and MS has included WASM related stuff like Blazor as a core part of .Net 5.

Some of these languages also have decent transpilers. E.g. kotlin-js works quite well, can reuse type definitions for Typescript, and e.g. Parcel added support for it some time ago. Likewise clojure script is a thing. However, javascript as a compilation target is a dead end as you would gain access to the same APIs from WASM, which makes transpilation to JS technically redundant long term.

Collapse
ย 
ortonomy profile image
๐Ÿ…–๐Ÿ…ก๐Ÿ…”๐Ÿ…–๐Ÿ…ž๐Ÿ…ก๐Ÿ…จ ๐Ÿ…ž๐Ÿ…ก๐Ÿ…ฃ๐Ÿ…ž๐Ÿ… โ€ข

I feel like the satire intentionally missed that it makes code sometimes unreadable, especially if the author has to use generics , R, S, T, U to make their typings work. This is a genuine frustration of using TS.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

You know, you can name your generics as you want. If someone is using R, S, T whatever, and you blame TS for it, is the same as someone naming a variable a, b, num, and blame the language for it. Of course, it makes more verbose the code, but is the price to pay for a better UX while developing.

Collapse
ย 
djmisterjon profile image
DjMisterJon โ€ข

TS should using only by IDE to provide good type for vanilla dev.
TS is good if you build API logic.
But is hell for use in project.
Use js+jsdoc if your IDE support.
in most case you get all reference in your project.
If your IDE not understand your js file, add some jsdoc +ts logic.
And if is not work , well , create a .ts file !
But ts is the last choice.

Learn jsdoc plz, this is the good way to doc and make ref to your logic.
/**
* App
* @param {object} props Component props
* @param {React.ReactNode} [props.children] Childrens passed by parents
* @param {function(MouseEvent|React.PointerEvent):void} [props.onChange] - Using function():return
* @param {import('csstype').Property.FlexDirection} [props.FlexDirection] - Using Import()
* @param {React.CSSProperties['flexDirection']} [props.FlexDirection] - Using array ['propkey']
* @param {Container.prototype['props']['orientation']} [props.orientation] - Using componment propTypes
*/

Microsoft with vscode (IDE) work hard to give good jsdoc support mixed with TS logic.
typescriptlang.org/docs/handbook/j...

Collapse
ย 
cdecompilador profile image
cdecompilador โ€ข

I understand the point, I came to Typescript from languages like c, c++ and rust just because of the strongly typed system, but I encountered many bad thing on it, generics are horribly bad implemented (the compiler does not infer the generic if there are too many indirections), the language lacks many functional features that reinforces your point, made by OO programmers to OO programmers, it would be great to have algebraic data types, unions, a better generic system (or use templates/traits). But still the idea is great in my opinion, an option that is done better in my opinion is haxe (compiling to javascript) but still not very popular.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

This are actually the best valid points to "hate" TS. The inferences could work better, and I know they are working hard to make them work better without having to sacrifice performance. I understand that the main goal of TS is to balance between correctness and performance, but it still need some work in that. Recent versions of TS shown better understanding and better syntax to use generic, and there is even a couple of proposals to declare named generics, and to infer other generics members.

Collapse
ย 
suppayami profile image
Cuong Nguyen โ€ข

Lmao

Collapse
ย 
quintisimo profile image
Quintus Cardozo โ€ข

Realised this was satire as soon as you mention flow being better ๐Ÿ˜‚

Collapse
ย 
speedopasanen profile image
Toni โ€ข โ€ข Edited

You almost got me there, nice satire :D

Collapse
ย 
rikyperdana profile image
Riky Perdana โ€ข

Just signed up, because this title do deserve a thumbs up!

Collapse
ย 
maximbalaganskiy profile image
Max โ€ข

Sorry, bad joke. Not even funny...

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

Sorry you didn't like. Maybe you'll like my other posts better. :)

Collapse
ย 
ulmas profile image
ulmas โ€ข โ€ข Edited

Ha-ha, well done, @michael! Happy I stayed put and read till the end. But not many people did!

Collapse
ย 
arafatamim profile image
Tamim Arafat โ€ข

Had me at the first half, not gonna lie xD

Collapse
ย 
matthias profile image
Matthias ๐Ÿค– โ€ข

Your article gave me a good laugh ๐Ÿ˜‚
But you forgot the #jokes tag.

Collapse
ย 
d1p profile image
Debashis Dip โ€ข

Nice sarcasm ๐Ÿ˜€ actually enjoyed reading this xD might skipped here and there though ๐Ÿ˜†

Collapse
ย 
ivawzh profile image
Ivan Wang โ€ข

Not many valid points in the article. Conflicting syntax against ES6+ is probably the only one.

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

Yet, they used them.

Collapse
ย 
nicklaswinger profile image
Nicklas Pouey-Winger โ€ข

Thank God I read this to the end ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚

Collapse
ย 
bdbchgg profile image
Dominik Biedebach โ€ข โ€ข Edited

Man I already was ready to shout out in agony and had my hands formed to fists to hit my table haha. Good one, you got me

Collapse
ย 
desone profile image
Desone โ€ข
Collapse
ย 
stereobooster profile image
stereobooster โ€ข

I don't get it. Why would you want to turn dev.to into orange site/twitter/reddit?

Collapse
ย 
lostintheway profile image
lostintheway โ€ข

I'm trying to learn TS, I didn't understand any of this. They don't declare classes anymore in js, what are you writing I don't get it

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

OK... I won't argue with you about TS, because you probably think the post was for real. But, Microsoft bought VS Code from who exactly?

Collapse
ย 
denysvuika profile image
Denys Vuika โ€ข

How do I downvote this shit?

Collapse
ย 
michaeljota profile image
Michael De Abreu โ€ข

You don't. Just enjoy it.

ย 
michaeljota profile image
Michael De Abreu โ€ข

Thank you for reading. But you didn't say anything about what's the editor that Microsoft bought to create VS Code. I really would like to know.

Collapse
ย 
motss profile image
Rong Sen Ng โ€ข

Would you like to give it another try before the end of the this year? See if it has any improvements so far to address the issues you stated?

Collapse
ย 
ufadacom profile image
Ufada Classifieds โ€ข

I also like staying with Native JavaScript, don't feel I can gain anything to adapt TypeScript.

Collapse
ย 
atonchev profile image
a-tonchev โ€ข

TypeScript is a joke, that makes programmers stumble

Collapse
ย 
desone profile image
Desone โ€ข

Read this article and you will know why typescript is taking over:

medium.com/me/stats/post/85c30a370ef5

Collapse
ย 
kruzus profile image
Bek โ€ข

I love reading articles written by beta developers.