Simplest Or Easiest

DoTheSimplestThingThatCouldPossiblyWork reads:

"First, implement a new capability in the simplest way you can think of... Second, and this is critical to the rule, refactor the system to be the simplest possible code..."

This is always followed by a whole lot of explaining and confusion (See DoThePartTwo). After all, why would I need to refactor if I already implemented the simplest thing in the first place? --KlausWuestefeld

It's the simplest way you can think of, so, somebody can find a simpler or better way to do it later. Besides, a lot of simple pieces of code put together start to be more complex, so you have to refactor to eliminate duplicated code and things like that. -- DanielMunoz

Thank you for the explanation. That's my point. Explanations like yours would be unnecessary if we said "do the easiest thing first and then refactor" instead of "do the simplest thing first and then refactor!!?!". --KlausWuestefeld

First implement the simplest solution. Then refactor to make the solution clear and adhere to OnceAndOnlyOnce.


A simple definition of "simple" is "few, small components". The DTSTTCPW quote says, "Do the thing that will work in the fewest, tiniest steps, then reduce the code to the fewest, tiniest pieces." But, yes, it's probably true that saying "easiest" is a better short-hand for "do the thing that will work in the fewest, tiniest steps".


We choose simple solutions first so that we can maintain focus on the customer's problem. Simple means easy to reason about. Easy serves as a synonym for simple so long as we remember that it is the thinking that should be easy. -- WardCunningham

Do the easiest thing that could possibly work, and then pound it into the simplest thing that could possibly work.

I think we are arguing about the terminology and missing the point. The whole idea is to get an initial solution without doing extra stuff that may be needed later (in 5 minutes or 5 years). Call it "simplest," "easiest," "minimalist," or whatever, just get me something that works, quickly with the least amount of baggage.
I think there is an important point in the terminology: Simplest != Easiest. Simple is difficult. (cf Mozart vs Rachmaninov and Saint-Exupery's quote "perfection is achieved when there is nothing more to remove). So it must be easiest first, I guess, and refactor to make it simpler -- BillWeston
Look, just get it done and working; and worry about making it pretty and witty and wise afterwards.
And for the CowboyProgrammers? out there, this is not to be confused with regarding simple elegant code as 'too complex' because it uses principles, techniques, and constructs that you have never bothered to learn (I meet a lot of folk to whom an untraceable 200-line hardcoded IF-THEN-ELSEIF/LOOP structure is regarded as "simple" while my replacement 3-line FOR EACH... DO ELSE loop is "complex and too hard to understand").
CategorySimplification

EditText of this page (last edited December 8, 2005)
FindPage by searching (or browse LikePages or take a VisualTour)