3 ms·
This is appealing, but taking this advice seriously means that all your relationships are many-to-many, until you optimize some of them to be one-to-many or one
by kragen 4y ago
This is appealing, but taking this advice seriously means that all your relationships are many-to-many, until you optimize some of them to be one-to-many or one-to-one.
This clashes extremely strongly with the currently popular approaches to software development (OO, procedural, Lisp/ML-style functional, SQL, etc.), which have an extremely strong default of cardinality 1, inflicting lots of extra work on you for many-to-many relationships. You'd never have a member of a struct or a class start out as an int or a string; they would always be int lists, string lists, etc. Points would have a list of X coordinates rather than a single X coordinate; interpreters would interpret a list of programs; 3-D objects would have a list of transform matrices rather than a single transform matrix; files would have a list of owners.
(And of course in languages like C and Golang when you nest a Foo object inside a Bar object, you are foreclosing the possibility of that Foo having the same relationship with some other Bar object as well; you need pointers.)
Systems that do support that kind of thing in one way or another include Prolog, miniKANREN, the APL family, and Pick. But Prolog and APL only support it to a very limited extent, and I've never used Pick or miniKANREN.
- vaidhy 4y agoI am not sure I understood your arguments because of where these get applied. I generally mean to apply these when we talk about business constraints - in my field of supply chain optimizations, these kind of things come up often. How many trucks do you plan between nodes? If the answer is 2, it means many. Being explicit about 0 and 1 means that if that constraint is broken, it means a more through code analysis as it would lead to some unexpected breaks in various systems.
- kragen 4y agoI certainly agree that 2 should be "many".