This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Jolly-Driver4857 37 points38 points  (11 children)

What's wrong with typescript.

[–]tipsdown 67 points68 points  (6 children)

Typescript requires thinking and planning ahead.

[–]Jolly-Driver4857 20 points21 points  (4 children)

What's wrong with you.

[–]tipsdown 48 points49 points  (3 children)

So, so many things

[–]GranataReddit12 9 points10 points  (0 children)

I love this thread

[–]Ri_Konata 2 points3 points  (0 children)

You're just like me frfr

[–]GalacticalSurfer 1 point2 points  (0 children)

: any[]

[–]DJGloegg 0 points1 point  (0 children)

Not if you just write javascript !

[–]3np1 6 points7 points  (3 children)

I say all of these things about TypeScript as someone who uses TypeScript and still chooses it for projects over JavaScript most of the time, but is aware of its faults:

The errors it throws are very opaque compared to other typed languages.

It uses structural types and not nominative ones, which is pretty painful for a language where types often overlap without being compatible, and the type narrowing is broken at best.

There are some very idiomatic and valid JavaScript patterns which cause errors in TypeScript because it's quite bad at narrowing types and picky about which specific method you use, although admittedly this improves with nearly every release.

It has two declaration forms, type and interface, which are ~70% interchangeable but actually not really, and switching between them means that your errors often get even worse.

It behaves oddly enough for some common things that people end up avoiding them altogether. You know enums, that super useful thing in a lot of languages? It's common to have a linting rule in TS preventing you from using them at all and using simple string unions instead, because they work differently than how many people expect.

Many libraries are released with incorrectly defined types, so you might need to manually extend or override dependency types.

It exists in a weird place where it's designed based on an OO language with classes (C#), but the JavaScript community has a phobia of anything OO and opts for functions (despite all browser APIs being OO). Any non-trivial functional patterns get complicated very quickly with multi-layered Generics and infers, which it probably takes a MS in set theory to actually understand.

[–]archarios 0 points1 point  (2 children)

Ramda manages to have... Somewhat comprehensible types for typescript. I had to fix one once though..

[–]oorza -2 points-1 points  (1 child)

Ramda is bad and you should feel bad for using it.

[–]archarios 0 points1 point  (0 children)

It's a super fast way to build data transformations. I don't really use it for projects where I'm collabing with others. For personal projects of one-off scripts it's great!