Writing a console game by making mistakes

I’ve decided to write a terminal, character based game. Main goal was to exercise a few software design concepts / patterns. So I started planning the game and afterwards figuring out the classes and entities needed for the overall project and design. Then I started TDDing on top of the initial design, and when I realized I suddenly had 8 classes. I had a Game class, a ConsoleViewport class, a Player, a GameInitializer class, a SpaceShuttle, a SpaceShuttleDisplayer… uff!

The initial goal was to do something extremely simple, but wanting to make sure everything had a single responsibility before actually getting some perceivable behavior led me to create new abstractions without any noticeable gain. There is no concrete issue on having all the above classes. But I think we have an issue considering that at this point in time the code couldn’t really do anything (not even display the game scenario). Abstrations must be justifiable, or they add only complexity.

So, next step is to throw it all away, and try BDD to lead the design, will let you know the results.