5 ms·
Talk about the title isn't terribly productive. I think the link to FP is on the money, though. A lot of code is easier to read and reason about as a pipeline
by repsilat 8y ago
Talk about the title isn't terribly productive. I think the link to FP is on the money, though.
A lot of code is easier to read and reason about as a pipeline (or DAG) of data transformations, usually as top-level functions on "raw" (and often immutable) data.
In Python it's often easiest to use a single-purpose namedtuple or some arrays and dicts rather than special classes. In JS "objects" are most commonly just hash tables used as structs to group related data together. And when I say "related", I mean "related by use", not "related by some taxonomy."
Redux/reselect is built on a similar model, too. Often the what the speaker calls "existence-based predication" is also employed by selecting "just active animations" so the consumer doesn't have to branch. Again, usually not for performance reasons, just softeng/maintainability stuff.
I still write classes with constructors and methods and private state etc, and sometimes still use inheritance and "virtual" functions, but not nearly as often as I did when I graduated from uni. That weight is just not always necessary, and it's not often the "right language" with which to express what I want to do.