Discussion
Challenging the Single-Responsibility Principle
HeavyStorm: > no matter how small a component already is, the single-responsibility principle can still be applied: every line of code can be assigned its own responsibilityThe definition of SRP is to have each class (or module) to have a single reason to change. I don't see how that has anything to do with having each line be assigned a responsibility. If the line changes for the same reasons as it surrounding lines, then, they are part of the same component (to use the author's wording). My guess is that the principle is being taken literally from its name/acronym.
citizenkeen: Much like Unbreakable, I felt like this ended just as it was starting to get good.
scuff3d: It didn't even get out of the introduction really. They described the problem as they see it, started to layout a solution, and then just fucked off. There should have been a whole example implementation showing each piece for the article to be useful at all.
Nevermark: Worth noting that in each well defined domain area, this can be replied recursively.I.e. within the domain are the (O) basic structures, relations and operations.Then (T) practical supporting algorithms, tuned for performance in specific cases, visualize information in different ways, or whatever.Then (A) the code that uses O & A to implement the details of specific solutions or manage specific processes.Wherever there is a well defined broad class of problems with shared structure, this approach has merit.• Minimize AT -> A, T, O or X.• Minimize A -> T, O or X.• Minimize T -> O or X.• Minimize T -> X.Where X is the blood type of ... well its just code that doesn't need to exist.
scuff3d: "I've seen many teams building distributed monoliths and spaghetti code in pursuit of the SRP."I've worked with probably 6 or 7 different "microservice" based systems at this point, essentially all of them are just distributed monoliths. I don't think I've met a single person at my company who actually know what the hell a "microservice" is.
carlosft: I just rewatches deadwood and i read your comment in the voice of al swearengen. I also tossed in a few "hooplehead" references for good measure.