3 ms·
Types are important and necessary. Can you skip them in a typed language? Yes, just use any, Object or whatever the equivalent. Can you add them to an untyped
by cel1ne 6y ago
Types are important and necessary.
Can you skip them in a typed language? Yes, just use any, Object or whatever the equivalent.
Can you add them to an untyped language? No.
They are not needed anywhere. But I argue that especially JavaScript module-systems would have benefited greatly from them.
A million lost hours in fixing obscure "undefined is not a function"-errors from output of highly dynamic pluggable build/transpiler-systems like webpack, requirejs, babel, buck etc. could have been avoided.
- nlitened 6y agoJavaScript is not untyped, it’s dynamically typed. The types are still there, they are just not enforced at compile time.
- Ericson2314 6y agoNo "dynamically typed" is an oxymoron, and untyped or "unityped" is correct. Please read https://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/ https://existentialtype.wordpress.com/2011/03/19/dynamic-lan..., the classic take-down of this mistake.
- cel1ne 6y ago"They are not needed anywhere." -> This should have been "They are not needed everywhere."
- AnimalMuppet 6y agoNo, they are not needed anywhere. Anything you can write, you can write in an untyped language. That's a pretty strict definition of "need", though. There are many situations where types can help, even if they aren't absolutely needed.