YAGNI and DRY
9th December 2003
Two acronyms that have been seeing a lot of action at work recently are YAGNI and DRY. They’re great principles to go by in any case, but in a pair programming environment they take on a whole new level of utility.
You Ain’t Gonna Need It states that you should always implement things when you actually need them, never when you just foresee that you need them.
This is great for controlling feature creep; the moment one of us says “we might need that later” the other says “YAGNI” and we can move right along.
Don’t Repeat Yourself is one of the tips from The Pragmatic Programmer, a book which is every bit as good as people say it is. It states that Every piece of knowledge must have a single, unambiguous, authoritative representation within a system
—whenever we spot something that is duplicated and can be considered a “piece of knowledge” we frequently refactor it straight away.
One of the most interesting things about pair programming is that introduces a complete reliance on communication into something that is generally a solitary activity. Guidelines like the two listed above extend the vocabulary that can be used in such communication, speeding up development and making tough decisions easier to quickly resolve.
More recent articles
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024