Re:Size is the best predictor of code quality (2011)
by candiddevmike on Friday November 11, 2022 @08:56PM
(#33569227)
Funny, everything you wrote can be applied to functions and classes too. Almost like software development can be summarized as "the balancing of WET and DRY".
For me, I follow the principle of three: if it's repeated three times with minor tweaks, I should probably make some kind of abstraction for it. I try not to start with abstractions, as they tend to distract from solving the initial problem.
Re:Size is the best predictor of code quality (2011)
by cxr on Saturday November 12, 2022 @06:53AM
(#33572236)
TRY: Try Repeating Yourself (as in, "Try repeating yourself first, and if that works, then good! If it doesn't, then okay, fix it then—but not before trying first.")
For me, I follow the principle of three: if it's repeated three times with minor tweaks, I should probably make some kind of abstraction for it. I try not to start with abstractions, as they tend to distract from solving the initial problem.