4 ms·
"Do one thing" is too short to mean anything. Originally it's about avoiding the quadratic explosion of the number of things that must be implemented. The meth
by Kinrany 5y ago
"Do one thing" is too short to mean anything.
Originally it's about avoiding the quadratic explosion of the number of things that must be implemented. The method is to replace M * N separate pieces of code with
- a single extra X thing
- M + N pieces of code
- a way to compose these M + N pieces of code to get the M * N you wanted in the first place
- karma_fountain 5y agoI think what you describe is preferable and is how I like to code in general, but then I find that the complexity comes from how these things communicate. It's not actually true in general that the whole is greater than the sum of the parts, but it's good to have a system that possess this property.
- vidarh 5y agoBut that complexity is even larger without this encapsulation into components. Reducing the complexity by reducing the potential communications surface is a large part of the point.