Thursday 3 February 2011

YAGNI. Or are you...?

"You Ain't Gonna Need It" - for me, one of the most completely misused pieces of jargon in the Agile lexicon.
More than anything else, this has been responsible for the misapprehension that agile processes are nothing more than hack-n-fix. The fact is, in many places it's not a misapprehension!

Don't fancy writing any technical documentation for the development you're doing?
"You Ain't Gonna Need It" - it's not like anyone ever reads spec's anyway

Don't feel like writing any user documentation?
"You Ain't Gonna Need It" - the functionality will probably change loads before you release it

Code comments?
"You Ain't Gonna Need It" - not with your brilliantly clear declarative coding style

Architectural design for complex system?
"You Ain't Gonna Need It" - make it do what it needs to do for the story you're on. We can't possibly know what we'll need in the future, so we'll just refactor it when we need to next year / sprint / week / tomorrow...?


Wellllll - yeah. But that's rubbish, isn't it? Sometimes you DO know what you're going to need.

What about the guy who's got to support the product or teach people how to use it?
What about the guy who's got to fix the bug or add the new feature in a year's time, who can't follow your brilliant style (and who will probably be you!)
What about the time you'll waste retro-fitting the architecture you could have got right in the first place?

Like any rule applied blindly and without thinking, YAGNI can get you into all sorts of trouble. Maybe more so.

Of course you shouldn't waste time writing complex technical documentation that no-one's ever going to read (although you should probably find out what it is they DO want, before doing nothing)

Of course you shouldn't comment your code like a first year under-grad and proudly tell everyone you're incrementing counter "i" by 1

And of course you shouldn't develop a powerful, flexible, reusable library for something you don't have any particular plans to do again

But you should at least think about what you do know.
Unless you don't need to do that either...

No comments:

Post a Comment