Re:Why I Prefer Dynamic Typing Over Static Typing (2017)
by SkyPuncher on Tuesday February 19, 2019 @11:43AM
(#19200254)
I understand that's the stated purpose. I'm demonstrating how I feel types can pretty much become useless when integrating with an outside system.
If everything is optional, then you might as well not use a type system in the first place.
Re:Why I Prefer Dynamic Typing Over Static Typing (2017)
by klmr on Tuesday February 19, 2019 @12:22PM
(#19200724)
Again, there’s virtually never a reason to make everything optional/variant. It’s a conscious design choice and should be used judiciously (otherwise the API becomes difficult to use, and the same is true in a purely dynamic system).
No, that is in fact the stated purpose of the type system. If you don’t want to make such a decision statically, you mark a field appropriately (e.g. via an Option type).