3 ms·
I'm not a huge fan of types because they don't model the real world accurately. In the real world, most concepts which we describe with human language have many
by jongjong 2y ago
I'm not a huge fan of types because they don't model the real world accurately. In the real world, most concepts which we describe with human language have many variations with optional properties and it's a pain and a waste of time to try to come up with labels to categorize each one... It induces people to believe that two similar concepts are distinct, when in fact, they are extremely similar and should share the same name. I hate codebases which have many different types for each concept... Just because they have a few properties that are different. It overcomplicates things and creates logical boundaries in the system before they are needed or well defined. It forces people to categorize concepts before they understand the business domain. People will argue that you can define types with optional properties, that's a fair point but you lose some type safety if you do that... If you can do away with some type safety (with regard to some properties), surely you can do away with it completely?
- myvoiceismypass 2y agoIf you flipped things a bit and think of types as more or less "allowed shapes of the things happening in my program", it might seem closer to the real-world comparison that you are thinking of.
- Kinrany 2y ago"Modeling the real world" only makes sense when you're building a simulator of some kind. Another similar approach is building a "digital twin" of something that is happening in the real world. But very often the software is the only implementation, there's nothing to simulate.