TITLE: When YAGNI Becomes "Now We Need It" AUTHOR: Eugene Wallingford DATE: December 01, 2014 2:05 PM DESC: ----- BODY: The Codist told the story of DeltaGraph last week. It must be quite a feeling to have code you wrote twenty-five years ago still running in a commercial product today. Of course, such longevity creates challenges for the maintainers. The longer a program lives, the more likely that a feature that you thought you'd never need becomes desirable, even necessary. Like a Windows version, circa 1989:
When I started the UI code I asked two questions of Deltapoint (1) will this code ever be ported to Windows (2) do you want to support multiple documents open at a time. The answer to both was no. Windows was still too primitive to care about and multiple open documents was fairly uncommon.
Within a few years, "You Aren't Gonna Need It" turned into "Now We Need It":
With 3.0 they actually began to port it to Windows 3.1, and it was an immense pain to do. I had spent no time trying to worry about cross platform issues as I had asked up front and been told no. Of course Windows was now becoming important. The port was never very stable as a result and I think it actually became a separate code base, making new features hard to do.
This is one of the balancing essential acts of writing software. Operating with a YAGNI mindset is generally a prudent way to ensure we don't write code that is unnecessarily complex and hard to work with. Yet we have to make our programs open to the changes that will inevitably follow. And some changes are easier to make if we have built hooks and fulcrums into the code. So, we strive for ways not to build the things we don't need now, but make it possible to accommodate them later. For me, this has always been the great promise of object-oriented programming. I try to think that way even when I'm working in languages that don't support the style directly, but I'm not good enough yet. That only helps me admire the accomplishments of teams like the one that created DeltaGraph even more. -----