3 ms·
Even if you're not doing OOP you're modeling your domain in one way or another. Whether those models are explicit and expressive or not, and how you define thos
by nauticacom 5y ago
Even if you're not doing OOP you're modeling your domain in one way or another. Whether those models are explicit and expressive or not, and how you define those qualities, is another question. In neither case are the arguments to a particular function typically a concept in your domain
- throwaway894345 5y ago> Even if you're not doing OOP you're modeling your domain in one way or another. Using structs to bundle function parameters doesn't preclude or inhibit using them for domain modeling.
- nauticacom 5y agoSure, but there's a purpose-built tool that doesn't overload an already existing concept, and it's called keyword arguments
- throwaway894345 5y ago> there's a purpose-built tool that doesn't overload an already existing concept I'm not sure which came first, but structs are a ~60 year old concept. That ship has sailed. Keyword arguments and structs are both named collections of values. Structs just happen to have broader uses. You can argue that we should use the more specialized one, but that's pretty silly--do we implement a general "add(a, b)" function or do we use more specialized add1(b), add2(b), add3(b) functions? Of course we use the more general tool even though a more specialized tool could exist.