2

Maybe it's just me but TypeScript seems to be loosey like JavaScript in certain ways in that it is quite flexible. Function overloading, type inference, and so on... lol.

Is that good design? Perhaps.

Comments
  • 4
    It's a devtool that was designed to integrate with Javascript that was written without regard to it. For a long time the vast majority of libraries were plain JS with APIs that followed the loosey sensibilities of JS, and Typescript had to be able to capture those APIs in a d.ts file. And I don't actually think that type inference is a flexible feature. On the contrary, its net effect is that your type system has to be pretty conservative about implicit casts, meanwhile the variables still need to have a type, you just may not have to spell them out. It's a convenience feature that encourages strictness.
  • 2
    it being a transpile annoys me
  • 2
    @jestdotty meh, to a certain level, even C is just transpiled. A sad ASM wrapper.
  • 1
    @whimsical Shhhhhhh! C is beautiful. No criticisms, please.

    /jk
Add Comment