Sunday, March 14, 2004

YAGNI

The Fishbowl has a piece on YAGNI, an acronym for "You Aren't Going to Need It", and one of the eXtreme Programming principles. This article really made my day, because my peers tend to tell me I definitely need to make things as generic as possible. While this doesn't need to be bad in general, I sometimes find myself working for hours to make something useable for all possible future cases one can think of (at the present time!), while a much easier specific solution might be at hand. One you can only use in this circumstance, but also one which you can code in 10 minutes. The next time you might need this specific solution in another circumstance; it will take only the 10 minutes it took you last time. Probably less for reasons of increased experience. Isn't the point of this whole thing that you need to be aware of general picture, instead of making virtually all things generic? Let's take, e.g., database access. You could build only one wrapper for all web based database access you'll ever need in every future project. It will take a substantial amount of time, but then again you'll never find yourself troubling with connection strings etcetera.
Only thing: software engineering principles tend to keep on develop over time. What's in common use today will be outdated tomorrow, and you bet in two years. Secure database access best practices will certainly change vastly. And what to think of new technologies. While at my company we're still on IIS 5.0 and ASP, and .NET being something we just look in to as something for the future. Suppose I'd put an abundance of time in building the most secure db access wrapper. It could be superfluous the moment we change to .NET.

(by the way, my colleague really had a good laugh last week installing VS.NET for the first time. Well, I told him - as I read it somewhere, don't remember - you surely need to write all your code from the ground up, cause this time there's no way to have your VS6 code converted to .NET. The next thing he does is opening up his favorite VB6 project in . NET, which launches some Wizard who exactly want to do just that, converting his project to .NET :)

Anyway, the YAGNI piece is an excellent example of my own opinion about software development. And , working my way through the comments I seem to be more of into eXtreme Programming than I'd thought.

Btw, Google search on YAGNI yields a lot of results, of which the specific article is already second, just below some XP Wiki site. Sounds cool, for something written just days ago!