The Wrong Question About Type Systems

16 points by voutilad


quasi_qua_quasi

You use maps, vectors, sets. Not custom classes. Every function you already know works on every piece of data. No "how do I get the name out of this Person object." It is just (:name person).

I've worked with a Typescript codebase at work that does this: no classes, just plain objects. It's utter hell to work with because you can't hide anything behind abstraction boundaries. You can't enforce invariants like "this list must be nonempty" because someone can just write { key: [] }.