One thing at a time
![Dodge gamer headset](https://loka.nahovitsyn.com/132.jpg)
Bob Martin refers to it as The Single Responsibility Principle: Complexity is a cost don't pay it twice.Īlthough Curly's Law definitely applies to normalization and removing redundancies, Do One Thing is more nuanced than the various restatements of Do Each Thing Once outlined above. Any time you see duplicate code, that's a danger sign.
![one thing at a time one thing at a time](https://2.bp.blogspot.com/-56m6jJWA0PI/Wu_KMK31hoI/AAAAAAAABq4/RPFWij3oFwo9fCAgLDKOM5DbQynO8z8YwCEwYBhgL/w1200-h630-p-k-no-nu/28.04.2018.jpg)
Often, it also means that you haven't properly thought through the organization of your code. Repetition leads to inconsistency and code that is subtly broken, because you changed only some repetitions when you needed to change all of them. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. This is one of the main goals, if not the main goal, when refactoring code. Don't repeat yourself is important if you want flexible and maintainable software.Įach and every declaration of behavior should occur once, and only once. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other.
#One thing at a time software
You stick to that and the rest don't mean shit.Ĭurly: That's what you have to find out.Ĭurly's Law, Do One Thing, is reflected in several core principles of modern software development: Curly's Law is defined in this bit of dialog from the movie:Ĭurly: Do you know what the secret of life is?Ĭurly: One thing. The late, great Jack Palance played grizzled cowboy Curly Washburn in the 1991 comedy City Slickers. It should mean One Thing, and should mean it all of the time.
![one thing at a time one thing at a time](https://quotefancy.com/media/wallpaper/1600x900/3430133-Jack-Kemp-Quote-The-power-of-one-man-or-one-woman-doing-the-right.jpg)
![one thing at a time one thing at a time](https://static3.srcdn.com/wordpress/wp-content/uploads/2021/01/One-Day-At-A-Time-Alex-Featured-Image.jpg)
It must not be both a floor polish and a dessert topping. It should not mean one thing in one circumstance, and carry a different value from a different domain some other time. In Outliving the Great Variable Shortage, Tim Ottinger invokes Curly's Law:Ī variable should mean one thing, and one thing only.
![Dodge gamer headset](https://loka.nahovitsyn.com/132.jpg)