3 ms·
Progressive typing gives you the option to type check when and if you want or need it. You don't _have_ to type. If things get really hairy but you know it's ri
by cobertos 2y ago
Progressive typing gives you the option to type check when and if you want or need it. You don't _have_ to type. If things get really hairy but you know it's right, you can focus on the code instead of the typing and efficiently complete your task.
There's also something fundamental about taking a dynamic language like Python or JavaScript and adding typing versus taking a static language and adding dynamic typing (e.g.`auto` in C#). The dynamic language allows modifications that are _really_ convenient if not a little hacky that you just can't easily express without big refactors in static codebases. Things like tagging objects with properties, making quick anonymous structs (before that became a thing in modern languages) so you can return tuples of values, other constructs like dynamic functions or whatever. Progressive typing is just so much more expressive
- agluszak 2y ago> taking a static language and adding dynamic typing (e.g.`auto` in C#) Assuming you meant C++ - no, auto is not a even a tiny bit dynamic. It's still fully static typing, but with type inference. The compiler will still prevent you from calling a method which doesn't exist.
- cobertos 2y agoAh yes, my mistake. `auto` is C++. I was thinking of `dynamic` and `var` in C#.
- needlesslygrim 2y agoUnfortunately, while `dynamic` is used for dynamic typing in C#, `var` is just type inferenfe like `auto` in C++.
- pjc50 2y agoEven "dynamic" isn't a true dynamic in C#, it ends up invoking methods via reflection, and using it for anything other than foreign COM objects is a massive code smell.