3 ms·
> or even worse not enforced even at runtime (JavaScript, I'm looking at you... 1 + "2" == 12). I'm having trouble taking seriously a post that beats this dead
by Tade0 3y ago
> or even worse not enforced even at runtime (JavaScript, I'm looking at you... 1 + "2" == 12).
I'm having trouble taking seriously a post that beats this dead horse.
Sure, it's there. It's even documented in the language specification, but now that we have template literals it's rarely used because truly, what is the expectation when using addition on two variables of different types?
As for static typing:
Grug put it eloquently: https://grugbrain.dev/ https://grugbrain.dev/
> grug very like type systems make programming easier. for grug, type systems most value when grug hit dot on keyboard and list of things grug can do pop up magic. this 90% of value of type system or more to grug
> big brain type system shaman often say type correctness main point type system, but grug note some big brain type system shaman not often ship code. grug suppose code never shipped is correct, in some sense, but not really what grug mean when say correct
In my opinion static typing is useful and I wouldn't start a commercial project without it. That being said I think it's productive to practice programming in dynamically typed languages, because:
-You avoid the sort of type golf that happens with a sufficiently powerful type system(I regret every use of the `infer` keyword in TypeScript).
-The situation forces you to be radically explicit.
-You can explore situations that would normally be hard/impossible to type.