|
|
|
|
|
by tsimionescu
1158 days ago
|
|
The point (which I don't 100% agree with, but can see) is that what it means to "only do one thing" is sometimes debatable. Say I write a 1000-line method that implements a red-black tree data structure, including returning closures that allow you to search for, add, or remove nodes. I could claim that this method does precisely one thing: it implements a red-black tree. Or, say I write a ten-line method that takes a list of names and returns the unique names ordered alphabetically. Someone could complain that the method does too much, because it both finds unique names and sorts them alphabetically. |
|