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
fedilink
13
edit-2
1Y

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
fedilink
51Y

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

@spytfyre
link
fedilink
11Y

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

@blank_sl8
link
fedilink
101Y

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.

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

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
fedilink
6
edit-2
1Y

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?

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
fedilink
2
edit-2
1Y

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
    • 7 users / day
    • 13 users / week
    • 29 users / month
    • 125 users / 6 months
    • 2.91K subscribers
    • 819 Posts
    • 1K Comments
    • Modlog