Hacker News new | ask | show | jobs
by Tainnor 636 days ago
Which is no worse than the situation in a dynamically typed language where every field in every object could be optional.

Dynamic typing advocates sometimes miss that statically typed languages don't force you to encode every invariant in the type system, just those that seem important enough.

Or, if you really want to go overboard, you could use a dependently typed language and write functions that only accept cars with a specific combination of fields not being empty. But that's typically not worth the complexity.