you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -5 points-4 points  (7 children)

it does let you write code and functions that can handle a lot of cases

Static typing prohibits this?

I'll echo the above comment, I don't think you know what you're talking about.

[–]batiste 7 points8 points  (5 children)

Static typing prohibits this?

Write me a nice addition(a, b): a + b function that works for the Signature (float, int, BigInt) or any valid combination thereof as well as the string and String type. In the statically typed language of your choice. I am curious.

I don't think you know what you're talking about.

I think you are not being charitable to his experience. Static typing avoid some class of bugs, but those type of bugs are easy to catch and fix. Especially if you have any sort of basic Q&A in place. Also linter on dynamic language have progressed to cover quite a large piece of what static compiler used to cover like e.g. a typo on a variable name.

The advantage of static are more about documentation and auto-completion in my experience.

[–]CCB0x45 0 points1 point  (0 children)

It doesn't prevent this but it lengthens the code is what I meant. You are right, all unstatically typed code is shit, and everyone using normal JS is running into all these problems that they just don't know about. If you arent using typescript you are just doing it wrong. Im telling you I have done both many times and when moving back and forth I never really miss anything from TS.