5 ms·
Agreed. I actually like Clojure and worked on a small project in it several years ago. But, the whole "Data Drive Design" idea literally just boils down to usin
by ragnese 3y ago
Agreed. I actually like Clojure and worked on a small project in it several years ago. But, the whole "Data Drive Design" idea literally just boils down to using general-purpose language primitives and data structures instead of defining specific classes/structs/whatever. That's it.
The idea is that if you just use dictionaries for objects instead of traditional, statically typed, classes, you get all of the dictionary APIs for free, so you can easily iterate over the keys, add more keys to the object as you're processing it (as opposed to defining a Foo class and a FooBuilder class, or similar), etc.
The pros and cons are obvious if you've worked in dynamically typed and statically typed languages.
That's not quite what this article is arguing against. This article is more arguing against a functional programming pattern, IMO.
- diarrhea 3y agoWhat 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.