YouArentGonnaNeedIt
YouArentGonnaNeedIt (often abbreviated YAGNI) is an ExtremeProgramming practice which states:
"Always implement things when you actually need them, never when you just foresee that you need them."
This may be another way of saying that the optimal program contains zero lines.
A scenario from Ron Jeffries explains the practice:
You're working on some class. You have just added some functionality that you need. You realize that you are going to need some other bit of functionality. If you don't need it now, don't add it now. Why not?
"OK, Sam, why do you want to add it now?"
"Well, Ron, it will save time later."
Unless your universe is very different from mine, you can't save time. You can only do less. So you are saying:
"We will be able to do less later (at the cost of doing more now)."
Unless your project is very different from mine, you already have too much to do right now. Doing more now is a very bad thing when you already have too much to do.
Unless your mind is very different from mine, you have a non-zero chance of not needing it after all, or of having to fix it before you even need it, when you refactor the class for some other reason. If either of these happens, you have completely wasted your time, in addition to giving yourself more to do right now, when you least needed more to do.
"But Ron, if I do it now I'll know how to do it, and later I might not."
"So, Sam, you're telling me that this class you're writing is so complex that even you won't be able to maintain it?"
Keep it simple. If you need it, you can put it in later. If you don't need it, you won't have to do the work at all. Take that day off."--Quoted from http://c2.com/cgi/wiki?YouArentGonnaNeedIt.
See ExtremeProgramming. Also applies to certain orphaned topics at this wiki. This is not one of those.