3 ms·
I agree with the article, but I will note that we have a great tool for this problem that is (or at least can be) "statically typed": the relational model. Data
by sirwhinesalot 1y ago
I agree with the article, but I will note that we have a great tool for this problem that is (or at least can be) "statically typed": the relational model. Databases are precisely what you want for this sort of problem (even better if it's Datalog and you can encode rules that derive relevant information).
Most mainstream languages are very poorly equipped to do relational modeling. ORMs are a disaster (object-relational mismatch) and you don't necessarily need an actual database running in the background.
Clojure's approach is superior to the class hierarchy or sum type solution for this sort of very loose business domain modelling, for the reasons stated in the article, but it's also a local optima, and so is the "fat struct" solution (which is the statically typed equivalent). Even entity component systems are but a shadow of the relational model.
- jiehong 1y agoIt’s part of the answer (the business logic stays as functions as expressed in the article). I’m glad people seem to have left behind the feeling that relational model is bad during the NoSQL era.
- mcphage 1y ago> I will note that we have a great tool for this problem that is (or at least can be) "statically typed": the relational model. Databases are precisely what you want for this sort of problem Relational databases still lock you into a specific design, and trying to work contrary to how your application was designed 10-15 years ago leads to terrible performance, high costs, and bugs galore. It may be better than other options, but it's still not exactly a solved problem.
- sirwhinesalot 1y agoTrue, it's not a 100% solution. I like Datalog specifically because a lot of the data ends up derived and the more common use of smaller pair or triple relations makes changes a lot easier.
- wredcoll 1y agoHow does the relational model or sql help with the problem of allowing vip customers to edit in-flight orders or whatever?
- sirwhinesalot 1y agoNothing allows that (except maybe Excel?), the author is imagining things with that one.
- wredcoll 1y agoBut you must allow it. That's not the question. The question is how best to represent it.
- deleted 1y ago[deleted]