Diary: Do the smallest thing

Today I continued working on introducing a dumb computer player into my Tic Tac Toe game.

I had a ringing in my ear saying “do the smallest thing to get it to work”, a nice message from my mentors (I must be learning something). So I figured the smallest thing to introduce a computer player was to create a new constructor that would accept a computer player and a human player.

At first this bothered me, because I wanted to introduce more abstraction straightaway. A class called GameSetup, that would setup a game and that object would then be passed in the game or…a factory object that would create different types of games, Human v Human, Computer v Computer etc….the temptation was great but I resisted.

In the end I accepted that firstly I must write the simplest and smallest (but not necessarily clean) code that will fulfil the spec, then I can go refactor to my hearts content once all tests are green, this is a lesson in discipline.

After all….. that is why I’m here (among other  things of course).

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s