Everyone loves TypeScript. There are a lot of good reasons to use TypeScript, but I am going to give you 7 really good reasons not to.
shilangyu (lemmur)
link
13
edit-2
9M

I’m so bored of people bringing up NaN !== NaN when talking about “javascript’s wonkiness”. This is defined by IEEE for the floating point standard and it appears in any other language using IEEE 754 (which is the majority)

@handvat
link
59M

You shouldn’t attempt comparing 2 floating point numbers with simply == (or === in JavaScript) in most cases and in most languages anyways.

@spytfyre
link
19M

Totally agree. Moreover I can not think of a valid scenario where you would use such a comparison

@blank_sl8
link
99M

Meh, not a great article. It gets off to a pretty poor start by stating that Typescript is “risky” because it has to interact with third-party APIs that are inevitably not written in Typescript. But really, it’s still a lot less risky compared to raw JS.

shilangyu (lemmur)
link
89M

A reason not mentioned here which is the only reason I would not use TS is the setup it requires just to get started

Mobocratic Egoist
link
79M

I think most are fair points, except I disagree that static types are not helpful. Static typing is preferable over dynamic typing but is difficult to do well. PHP and Python have type annotations now, and I think it would be good if JS introduced them as well. That would be a better solution than TypeScript.

shilangyu (lemmur)
link
6
edit-2
9M

It would seem to me that introducing typing to JS like in Python or PHP would just end being TypeScript, so why would it be a better solution? Do you mean it being a first class citizen in the JS world?

Mobocratic Egoist
link
49M

Yes, I mean making it a first class citizen of standard JS. That would be a step towards all JS libraries coming with type annotations without having to convert everything to TypeScript.

@AlmaemberTheGreat
link
2
edit-2
6M

deleted by creator

General Programming Discussion
!programming

    A general programming discussion community.

    Rules:

    1. Be civil.

    Other communities:

    • /c/rust
    • /c/python
    • /c/powershell
    • /c/haskell
    • /c/fpcomplete
    • /c/cpp
    • /c/c_programming
    • /c/julia
    • 0 users online
    • 4 users / day
    • 19 users / week
    • 53 users / month
    • 147 users / 6 months
    • 2.77K subscribers
    • 792 Posts
    • 1.14K Comments
    • Modlog