Just had a really interesting discussion about design and over-design.
I was asking someone their opinion about using raw collection types instead of introducing a specific domain object. The type in question was a map of integers to lists of strings.
We chatted for a while about it and came to no firm conclusion, had some good principals though, like code readability and ease of maintennance.
After we realised that I was just about to come up against a bit of code which makes the decision for me – I suddenly required extra information about this map, which I would have to pass in another map, or introduce a domain object.
Suddenly its not an esoteric design argument but a concrete necessity.
This is something ive noticed before but not formalised… If you cant make a decision about something, don’t do it just make sure its not duplicated, etc all the basics.
As soon as a decision becomes esoteric or starts being about what things might get used for, YAGNI kicks in.
This could be summed up as Delay design decisions until as late as possible wait for a compelling reason to do something and then refactor rather than spend hours arguing over a beautiful design which will always be wrong.
This fits well with kent becks idea that you are always adding features to an existing system. Change the system just enough to make it simple for you to add the feature then move on.
