Thursday, January 8, 2009

Most powerful agile principal YAGNI

So i have been practicing agile software development for a while now and there are lots of powerful concept that i use during development:

  • Time boxed iterations
  • No big up front design
  • Design evolution
  • Test Driven development
  • Pair programming
  • User stories
  • Refactoring
Many of the power of these concepts have the sum is greater than the parts effect. When they are used in unison the become even more powerful kind of like the power rangers.

Anyway one of the most powerful concepts is YAGNI(You ain't gonna need it). It is so simple in many ways yet so powerful. It is really a kind of extension to another XP principal "do the simplest thing that works". The idea at the micro level is that a code feature should do enough to pass the unit test and integration tests and NO more. Anymore that is over engineering.

The idea being that is is silly to do work today for something you think you MIGHT need tomorrow. Rather take the view you can't predict the future and that you probably WON'T need that feature in the future when the future come. Instead in the future you will learn something new and want a different feature. So although "do the simplest thing that works" principal is powerful at the code level... YAGNI can be applied all over.

The Grails framework is great example of applying the YAGNI principal. It uses convention over configuration because You Ain't Gonna Need configuration.

YAGNI problems: Hard to adapt because of old habits.

It can be hard for older developers to adapt to YAGNI because traditional software development encourages you to make your code generic and reusable, to be able to do everything even make the coffee. However reusable application code is a myth. YAGNI is also hard to measure. How do you measure the time you have not spend on doing something. YAGNI can also be boring for some developers. Some developers like yak shave as in find the most complicated (but stimulating) way to solve a problem.

My suggestion for this is. Just do YAGNI. Don't try, just do. As YODA says there is no try only do or do not!!!.

Once you start doing YAGNI your joy and motivation will come from building things that people want and not what you think they want. More people will use your software and will benefit from it. It will also reduce the 80/20 rule where 80% of people use only 20% of the features. Finally you will actually ship software fancy that.

Once you start practicing YAGNI. You can start applying it to your life. Use it for things like:

  • Packing your suit case for holiday.
  • Ordering food at a restaurant
  • Life insurance :)
You get the idea.

One more thought:

Henry Ford once said: "if i asked the people what they wanted they would have said a faster horse"

enjoy :)


Ernie said...

I thoroughly enjoyed this post. I am effectively one of those "old developers" that you speak of. So, I am constantly trying to fight the 'reuse' mentality that tends to slow me down.


Peter Delahunty said...

Hi Ernie

Thanks for your comments good to see the post sparked some thoughts for developers. I too am one of those "old developer" battling with old habbits. I like to think i am reformed now and i certainly practice YAGNI in my contracting day job for clients. However for my own side projects I can still find myself Yak shaving because i for my own projects i always want to build a rolls royce when only a mini is needed.

buy custom essay writing online said...

By the way, yesterday received a response regarding their participation in the ad network - not yet taken. Let's wait what will happen next.