3 ms·
I don't agree at all that this phenomenon is restricted to database programming. Thinking in terms of higher-level operations is always more readable and often
by thurn 15y ago
I don't agree at all that this phenomenon is restricted to database programming. Thinking in terms of higher-level operations is always more readable and often more efficient (the logical conclusion being things like Haksell and Prolog where there aren't really operations at all).
For example, to find the common elements in two lists, you could use a for loop, or you could follow the OP's advice and use set operations to do something like:
set(list1).intersection(set(list2))
- calibraxis 15y agoYes, I often use clojure.set's relational operators. (select, project, join, etc.) Because it's common to deal with sequences of tuple-ish data. It's natural, once you lose this limiting notion of "objects" which aren't represented in a generic way.