Skip to content

Instantly share code, notes, and snippets.

@amcdnl
Last active April 29, 2024 23:04
Show Gist options
  • Star 169 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save amcdnl/b52e9dd11850eeb8de8f to your computer and use it in GitHub Desktop.
Save amcdnl/b52e9dd11850eeb8de8f to your computer and use it in GitHub Desktop.

Why I hate TypeScript

Warning: These views are highly oppinated and might have some slightly incorrect facts. My experience with typescript was about 2 weeks in Node and a week in angular2.

Not Standard

TypeScript is implementing their own take on JavaScript. Some of the things they are writing will likely never make it in an official ES* spec either.

Technologies that have competing spec / community driven development have a history of failing; take: Flash, SilverLight, CoffeeScript, the list goes on. If you have a large code base, picking TypeScript is something your going to be living with for a long time. I can take a bet in 3 years JavaScript will still be around without a doubt.

Its also worth noting that they have built some things like module system and as soon as the spec came out they ditched it and started using that. Have fun updating!

It should also be worth mentioning that this language has been around for a long time and only recently gotten popular because of Angular2.

Not Community Driven

There is no community really driving the language itself. From what I see, random new things end up there with little to no community feedback. I could be wrong here, but I just don't see it much.

Types in a non-typed language is hard

Its like trying to fit a square into a circle hole. A lot of the ES6/7 things I try to do don't work at all and will likely never work with the way some of the types work. I think it should be JS first and then types not the other way around.

It probably doesn't help that the main people that wrote this weren't big JavaScripters before they started but thats just my personal thought.

Babel is way better

Babel is the ****! The plugin architecture system is amazing idea! I love being able to get community driven plugins ( Even if they might not be standard thats the risk I accept and am ok with ). I can target multiple environments ( node 4,5 / browser ). Plus, they are implementing specs and even if they are stage-0 and change, they are atleast some spec and i can run that plugin until I can update too.

I've been watching some of the targeting issues and they are pretty far out, TS on Node seems like a great fit, why not get that going asap?!

Babel is just SOOO far ahead ... The fact that people are using Babel and TypeScript together is a huge flag that TS needs to up their game.

TypeScript Definitions

Um, why do I need to mock fake TSDs for things that aren't TypeScript!? Your creating more headache, work, etc. This should have been addressed in v0!

No idea what language features I can use

I hit this all the time, I had no idea what ES* features I could use and what I couldn't. I spoke about this on a issue and they said they are only doing stage-3 but they have other things that are stage-0?

They lie

I think I've heard about 100x you can use as much or as little of it you want. Ya, good luck. Having to put any everywhere is not my idea of that statement.

What about flow?

I do generally like the approach FlowType is taking.. they put JS first and then lay types on top. Also, I can use babel to compile it and its not as much of a plunge into a java/c# like language.

TS and Babel are doing similar type declaration syntax so its a safer bet that might be included in a upcoming spec and if it doesn't you can always use babel-remove-flow-types ;).

@levancho
Copy link

TS is waist of time, I thought that it would be as pleasant of a language as actionscript 3/ ECMA 4, once was, but no it is mix little bit of everything.. I will not use typescript for my future projects anymore.. back to vanilla javascript for react and RN.

@jTiKey
Copy link

jTiKey commented Aug 14, 2023

I fight with the types more than I code. The console logs are just a wall of useless warnings for 10 rows about missing one comma. Everything is slow and laggy on an expensive laptop. The files are miles of code, it's always a maze to find what you need. I spend multiple more time on stuff I would do much quicker in js.

@nabato
Copy link

nabato commented Sep 1, 2023

"Types are worth of every additional hour you spend on them. There is no evidence, just believe me bro."

Several years later and my daily job is Clojure and it's a bless. But in rare times of frustration I visit this page to remind myself what a circus frontend development has been since TS introduction.

@mjobuda
Copy link

mjobuda commented Sep 1, 2023 via email

@milahu
Copy link

milahu commented Sep 2, 2023

I recently discovered that one could write js in a lispy way. Just use normal functions and call them ordinarily. [...] So why is nobody using it like that?

because javascript is not a functional language. javascript has no tail call recursion, so sooner or later you will hit the "maximum call stack size exceeded" error, and the function call overhead makes functional style slower and more memory-hungry than imperative style... but you can implement lazy functions and trampolines in javascript, and some functional languages are hosted on javascript, like clojurescript

@mjobuda
Copy link

mjobuda commented Sep 2, 2023 via email

@nabato
Copy link

nabato commented Sep 6, 2023

@mjobuda Don't listen to TS bigots. JS was planned as a Scheme in the browser. It was designed to be a modern functional language by its creator, but OOP fanboys disfigured it with Classes™ and Inheritance™.

@knightedcodemonkey
Copy link

Another popular web framework drops TS: hotwired/turbo#971

@jimmywarting
Copy link

All for it! 👍
but the way turbo went about it was a bit drastically. they could have done it more cleanly.

@tamtm
Copy link

tamtm commented Oct 22, 2023

@mjobuda Don't listen to TS bigots. JS was planned as a Scheme in the browser. It was designed to be a modern functional language by its creator, but OOP fanboys disfigured it with Classes™ and Inheritance™.

hell yeah, they can't handle javascript's prototype-based programming, so they have to add classes

@archcra
Copy link

archcra commented Oct 22, 2023 via email

@tamtm
Copy link

tamtm commented Oct 22, 2023

if you want to check types, just make a function to do it, there is no need for a whole language

@archcra
Copy link

archcra commented Dec 24, 2023 via email

@BeKnowDo
Copy link

Let’s be honest, TS advocates don’t really care about type safety. They just want their IDE to help them understand function signatures.

+1

@archcra
Copy link

archcra commented Apr 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment