5 ms·
What are the pros? Even in Python, where such an approach is not unheard of, it sounds horrendous. Dataclasses and pydantic became popular for a reason.
by diarrhea 3y ago
What are the pros? Even in Python, where such an approach is not unheard of, it sounds horrendous. Dataclasses and pydantic became popular for a reason.
- resoluteteeth 3y agoI'm not really familiar with data driven development, but in languages with row polymorphism it can be pretty useful to be able to do things like add/remove properties to objects as you go. Personally I wouldn't want to throw out type safety to try to do that in a language without the type system to handle it safely, but I guess I can see people choosing to do that?
- travisjungroth 3y agoA classic rant by Rich Hickey: https://youtu.be/aSEQfqNYNAc?si=XBVI4cAtUlSPSU-v https://youtu.be/aSEQfqNYNAc?si=XBVI4cAtUlSPSU-v I say this even though I don’t usually code this way: I think the big benefit for business code is sort of a constrained flexibility. Objects tend to get really big (the alternative is you have a ton of classes). Think about all the data that makes up one Uber ride. So if I want to do anything with a Ride, I need everything. An even the many classes thing doesn’t really solve that because maybe what I want is cross-cutting. So either way, I just end up having to supply a bunch of stuff I don’t need. The maps-first approach is more incremental. Every function takes what it needs and gives what it can.