The Artima Developer Community
Sponsored Link

Articles Forum
The Simplest Thing that Could Possibly Work

9 replies on 1 page. Most recent reply: Jan 18, 2004 9:00 PM by Bill Venners

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 9 replies on 1 page
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

The Simplest Thing that Could Possibly Work Posted: Jan 18, 2004 9:00 PM
Reply to this message Reply
Advertisement
Ward Cunningham talks with Bill Venners about complexity that empowers versus complexity that creates difficulty, simplicity as the shortest path to a solution, and coding the simplest thing when you're stuck.

Read this Artima.com interview with Ward Cunningham:

http://www.artima.com/intv/simplest.html

What do you think of Ward's comments?


Derek Inksetter

Posts: 1
Nickname: dinksetter
Registered: Oct, 2003

Re: The Simplest Thing That Could Possibly Work Posted: Jan 19, 2004 7:16 AM
Reply to this message Reply
I think the advice got turned into a command: "Do the simplest thing that could possibly work." [...] But as soon as it becomes a command, then we have to analyze it and ask, "Is that the simplest?" And all of a sudden it becomes complicated. What is or isn't simple?

So for you, Ward, it's a technique, not a guiding principle. I think that's a huge distinction.

In programming, a lot of simplicity comes from knowing what matters and what doesn't matter.

So there is an art to knowing where things should be checked and making sure that the program fails fast if you make a mistake.

It seems like you're saying that good/experienced developers really do make a difference when it comes to the balance between simplicity and complexity. I really like to hear this coming from someone with loads of credibility in the industry. Many methodologies are focused on making average and below-average developers productive. It's no secret that the productivity of the best programmers can outpace the mediocre ones by orders of magnitude. What seems to be said less often is that the quality of their work is higher too.

The value of experience is far too often ignored in this business.

Scott Bockelman

Posts: 7
Nickname: mafjgbs
Registered: Feb, 2003

Re: The Simplest Thing That Could Possibly Work Posted: Jan 21, 2004 10:16 AM
Reply to this message Reply
I think the strategy described is more-or-less a "just do it" kind of thing, which is valid, but I think it is critical that developers understand the notion of refactoring in this context. Unless the atmosphere and attitude is one in which programs are constantly being refactored, this strategy can easily degrade into "whatever works" (today).

I often inherit the code of others. If the others' code is well-factored (simple?), then I can understand it quickly, fix defects, add features, enhance it, optimize it, whatever. But if the code is not well-factored, I face "difficulties" instead of savoring problems.

So, "the simplest thing that could work" should probably not be an end state, unless one considers "the simplest thing" to be the one that is most comprehensible to the next coder. And I don't get the sense from the article that that was what Ward had in mind when he coined the phrase.

Maybe I'm missing his point, but for me "the simplest thing" can sometimes takes months at which to arrive (after several rounds of refactorings and sometimes entire rewrites).

I wish the waters were not so muddy.

Florian Hehlen

Posts: 1
Nickname: flo
Registered: Feb, 2004

Re: The Simplest Thing That Could Possibly Work Posted: Feb 12, 2004 10:36 AM
Reply to this message Reply
hi.

I totally agree with you. If itterative development is endorsed by management then this approach is fine and there is a clear path: Do the simple solution, and as soon as the simple solution is no longer acceptable: refactor, rewrite, decouple, etc...

But in a world where software development management often works on the principle of "if it ain't broke don't fix it", then a simple solutions quickly become unmanageable legacy-ware!

I am a big fan of WC and all of the Agile Software Dev approaches... but i am getting the feeling that to often agile software dev. approaches come off as an excuse for "just do it"... and that bugs me cause I have seen the "just do it" approach and it's not the same!

Florian

David Ramsey

Posts: 34
Nickname: dlramsey
Registered: Apr, 2002

Re: The Simplest Thing That Could Possibly Work Posted: Feb 13, 2004 1:24 PM
Reply to this message Reply
The "just do it" attitude also presumes seemingly infinite resources to go and "just do it". As Florian notes, getting management to commit to the time (i.e. dollars) to change something that is not (yet) broke can often be a painful exercise in frustration. And further, from the point of view of the business, it makes no sense to spend those dollars yet. No one has complained (yet) and may never complain.

What I've learned to do is save such changes since the refactoring also simplifies (usually) and when some other change comes in that is hard because it depends on something in my codebase that is hard and I've not been allowed to make simpler, then is when I push at management the benefits of letting me refactor and simplify. And that tends to work most of the time, if I can help them reduce time-to-market for an update or new features.

ilPostino

Posts: 8
Nickname: ilpostino
Registered: Feb, 2004

Re: The Simplest Thing That Could Possibly Work Posted: Feb 19, 2004 6:22 AM
Reply to this message Reply
I loved this article and I'm going to print it out so other developers here can read it every time they get stuck! I'm the developer here everyone hates because I always ask why? why is that so complicated and why not just code it, I think I work in a simplistic way because everyone understands my code, I can write complex code that even I won't understand a week later, it is fun but counter productive ;-)

I'd like the idea of just coding it, then you can try understand it and maybe refactor it.

-Craig

Javid Jamae

Posts: 16
Nickname: javidjamae
Registered: Jan, 2003

Re: The Simplest Thing That Could Possibly Work Posted: Mar 9, 2004 7:13 PM
Reply to this message Reply
A friend of mine once said that there are problems and there are difficulties. A problem is something you savor. You say, "Well that's an interesting problem. Let me think about that problem a while." You enjoy thinking about it, because when you find the solution to the problem, it's enlightening.

I personally prefer the word "challenge" over the word "problem" when used in the way that Ward Cunningham refers to it. "Problem" can mean "challenge", but it can also mean "difficulty". Like when one says, "that's no problem", they mean that there is no difficulty in accomplishing something, not that there is no challenge.

Brad Appleton

Posts: 3
Nickname: bradapp
Registered: Mar, 2003

Re: The Simplest Thing That Could Possibly Work Posted: Mar 25, 2004 9:30 AM
Reply to this message Reply
I think Ward is saying there are two parts to "doing the simplest thing that could possibly work" - the present simple and the future simple

I think the present simple is the advice for what we are supposed to worry about today, in the here and now, and is where the advice/question "Do the simplest thing that could possibly work" applies.

I think the future simple is about emergent simplicity that results from doing the simplest thing and then paying continuous attention to quality so that we frequently and iteratively: reflect, refactor, reform and rewrite at each level of scale/granularity in our process and practices.

When you do simple today, and follow that with continous attention to reflect and refactor, etc. - then we can rest assured that the end-result really and truly will be the one that:

1. passes all the tests
2. removes all redundancy
3. expresses/reveals all it intends and intends all it reveals/expresses
4. uses the fewest number of classes/artifacts and methods/words

I have to have both the present and future "tense" of simplicity in effect, in order to trust that doing the locally simple thing today will ultimately result in the globally simplest result tomorrow.

Warren

Posts: 5
Nickname: curmudgeon
Registered: Apr, 2004

Re: The Simplest Thing That Could Possibly Work Posted: Apr 5, 2004 2:50 AM
Reply to this message Reply
When you are stuck, it makes sense to try the very simplest thing that might possibly work as a sort of stub. When you know what you are doing because this is the 217th program you've written against this particular database or whatever, you know the API, you know the data, and you know your customers, and you need a special program for a special purpose, you code it right the first time.

For code that goes into production, you need to make sure you haven't left in any of these partial solutions. One way is never to write any code that you are not totally sure of. Testing, of course, is also required. When the cost of error is loss of human life or firing weapons or crashing the stock market, you might not want to pepper your code with syntactically correct code that "nearly works". And there is a point of view that we should code everything as if human life depended on it, since we see that there is so much software failure out there.

As a side note, it is interesting that there is no other area of human effort, besides software development, where the practitioners spend so much time and effort trying to figure out how to think about their work.

Michael Stueben

Posts: 4
Nickname: csteacher
Registered: Nov, 2015

Re: The Simplest Thing That Could Possibly Work Posted: Nov 30, 2015 8:42 PM
Reply to this message Reply
Ward wrote "I'm not a fan of checking arguments."

The best example I know of checking and not checking arguments is a dot product function, say dotProd(x,y). What doesn't have to be checked--and shouldn't be checked--is that x and y are 1) sub-scripted sequences and 2) the elements are numbers, not characters, etc. If either is not true, then there will be run time errors. Hence, checking is unnecessary and will slightly bloat the function. But what MUST be checked is that the lengths of x and y are the same. If that is not true, then the function may return a number that makes no sense. This will be a hard-to-track-down-bug.

So "yes" and "no" to the necessity of checking arguments.

Flat View: This topic has 9 replies on 1 page
Topic: Trip Report: Ad-Hoc Meeting on Threads in C++ Previous Topic   Next Topic Topic: Testing Private Methods with JUnit and SuiteRunner

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use