Best Practices: Source Control

To this point in my game journey, I have not been using source control.

For shame.

Vader_SourceControl

I know better than that. I am a veteran of many years of software development. It’s one of the things I ask about in job interviews.

So why haven’t I been using version control so far? I could write some excuses, but in the end it comes down to laziness. I haven’t had something go horribly wrong after being right. Nor have I had a program so complex that the safety net seemed mandatory. That has now changed with my current project: Space Bowls.

I was in the midst of refactoring some code (to align with the Single Responsibility Principle), but as I continued I discovered that the game was not behaving properly. From this I learned that I probably need some practice refactoring, and that I should definitely get some version control in place.

Thankfully, for this project I had been taking full-folder backups (into a zip file) at certain points…including before the refactor. So, after taking a backup of the current state in all its broken glory, I restored my code base before the refactor.

When I opened the project, I discovered something else…that I’d also been adding features while working on the refactor. That is another faux pas.

As I keep saying…these projects are for building my game portfolio and honing my skill set. They are not likely to be works of art…not yet. But that is why I’m building them – so I can build the next one, which will be better.

Stark_Git

I have now added source control to my project, and restarted the refactor. I’m using GitHub Desktop, so we’ll see how that goes.

SB_WaitingToBowl

Space Bowls, waiting to bowl.

Closing Thoughts

  1. Source control is very important. Don’t wait for the catastrophe to strike before you start using it.
  2. Refactoring is good practice, but..
    1. make sure you refactor in isolation (no adding features while you refactor)
    2. and test frequently. Just because your code looks better, doesn’t mean it still works.

One comment

  1. Dianne Gravel · · Reply

    Keep on keeping on

    Like

Leave a comment