39
dested
7y

It's stuff like this that makes typescript the only way to write modern JavaScript.

Comments
  • 15
    Yeah, one can detect typos early on, like "ptopname" instead of "propname" (real example from this morning). That's one of the things I hate about uncompiled languages, that you can type basically anything and the code runs but is wrong.
  • 2
    Uh didn't know that's possible in ts, thank you!
  • 1
    I think this example is way over engineered

    A senior dev would laugh if she/he makes that mistake, a junior might learns something facing the resulting runtime error without TS.
  • 4
    @ronnyhaase it's just an example to demonstrate the possibility.
    And in more complex scenarios it very much does make sense.

    P.S.I don't think it's overengeneered.
  • 3
    Luckily JS distinguishes null and undefined, making typos easy to find! Lua, however...
  • 3
    Writing code in pure Javascript should prohibited by law, TS is the only way 😁
  • 0
    What do you guys feel are the benefits of typescript in front end development?
  • 0
    Yeah, this is not actually exclusive to TS, implementing it is no different in plain JS.
  • 3
    What I really mean is that this is not a benefit of TS and you can do the same in JS.
    https://quokkajs.com/docs/... eg
  • 1
    Ya, I tried typescript, and it's overkill, my liner deals with simple things like typos and wrong vars, and beyond that I know how to write my damn code.
  • 2
    @pr0gg3r while probably not true, and probably useful to some, many Front-end even some backend guys believe typescript was made to ease the transition from back to front for devs.

    I spent a decade not needing it before it came out, I tried both bits and flow, they both just get on my way, and TS not having full or even the same level of esnext support as babel creates even more problems when I write code it cannot compile because it's behind the times.
  • 0
    @RTRMS thanks I was looking for a good insight based on experience like you just laid out.
Add Comment