Re:Why I Prefer Dynamic Typing Over Static Typing (2017)
by steveklabnik on Tuesday February 19, 2019 @11:13AM
(#19199949)
The way this works is, when you say “please turn this JSON string into a data structure”, it’s a fallible operation. So, if that JSON string does not have what you expect, the serialization operation will fail. You can “check at compile time” by the system ensuring that you handle the success and failure cases. Additionally, it means that if you have an instance of that data structure, it is always valid; it is checked (at runtime) upon creation.
Does that make sense? I can show you some code if you’d like.
Does that make sense? I can show you some code if you’d like.