3 ms·
Not the person you're asking, but the culture around data representation strikes me as the biggest factor: 1. Only making valid states possible, to the greates
by gpm 4y ago
Not the person you're asking, but the culture around data representation strikes me as the biggest factor:
1. Only making valid states possible, to the greatest extent reasonably possible.
2. Treating error as regular data, not an afterthought - with language features to make that not too painful.
3. Not returning placeholder values (i.e. if you get back a parsed value from a parse function, it means it parsed correctly, not that either there's an error somewhere else or it parsed correctly).
Language features, in particular "enums" (aka algebraic data types, aka tagged unions), make this approach possible. You couldn't do it in go, for instance, even if there was a cultural decision to.