16

Why is Typescript such a snarky fuck?

a: number = 2;

tYpE Is TrIviAlLy InFeRReD fRoM NuMbeR lItERaL

Shut the fuck up you barely turing complete piece of digital refuse. Why does it bother you so much if I leave the fucking type on for clarity? This is almost as bad as my ex.

Comments
  • 1
    Yeah, it is a terrible default.
  • 5
    I’m siding with TS on this one. You should type your variables on declaration and not on assignment.
  • 5
    If it a warning I guess its tslint or prettier or similar and if so you can most likely configure it.

    The language has no problem with explicit typing if you want to but some linters/formaters have defaults set to suggest you skip the obvious types to make the code smaller.

    But You can usually change which such rules they should apply or not based on team or personal preference.

    And yes, such rulesets can often be opinionated ;)
  • 1
    @Voxera this! 💘
Add Comment