TITLE: YAGNI: It's Not Just for Agile Programmers Any More AUTHOR: Eugene Wallingford DATE: June 25, 2010 12:19 PM DESC: ----- BODY: This is the quote of the day from my reading, drawn from a relatively old blog by Giles Bowkett:
YAGNI and "scratch your own itch" don't just keep code clean, elegant, and succinct, they also keep it honest. The worst code you will ever encounter in your career will contain program logic which does something completely different than it claims to, either in its comments or its method, variable, and object names. Programmers spend more time talking about good and evil than priests or preachers do. The reason is simple: bad code is nothing but lies.
I think beginning programmers don't often realize how many different ways that code can lie to us. Moreover, their lack of experience building large programs and living with programs over time usually means that they have no clue at all why this matters, or how important it is. I am also surprised that so many experienced programmers seem not to grok this yet, especially the role played by doing the simplest thing you can to implement a feature. YAGNI helps us to write more honest code because it helps us to be more honest to ourselves. -----