Thursday, December 11, 2014

Making Life Easier with GitHub

When I'm working on a software program, too often, I've been elbows deep working on a feature, and suddenly my program breaks and I can't compile. I end up having to backtrack my changes or, when I am really at my wit's end, I make a backup of the current version and repeatedly hit "undo" to try to get the program back to a working state.

It's frustrating, so I moved on to "save as"-ing religiously. I end up with a folder looking like this:


I'm slightly embarrassed showing this to you, but it's what I did. It works ok because I can get back to old versions, but
  • I have to recall what the titles mean
  • It takes up a lot of unnecessary space since I am creating new versions of each file even if only minor changes were made.
  • It's not that easy for collaborating. If my colleagues wanted to go through this, I'll have to do a lot of explaining.
Since working with more software engineers, I've learned this amazing thing called version control. It's a system that helps you manage changes of documents and computer programs. Git is a popular program that many developers use.

At first, the idea of learning Git was daunting. I heard my colleagues saying a lot of new terminology and commands. However, when it was time to start a new project, I decided now was the time to buckle down and learn Git. I found a free Udacity course and it was great. This course explained the important concepts in easy-to-learn chunks with useful examples, all in 3 simple lessons. It took me about 20hrs scattered over a period of 3 weeks to finish this course. These are the positives I took away:
  • As long as I commit (i.e. save as) often, I will be able to go back to any point in time. When I break the code, I can just go back to the previous commit.
    • I currently only know that GitHub works with programming documents. I would love to be able to do this with essays and Photoshop projects. This is something I will look into when continually save as-ing those documents becomes an issue.
  • Since I can always return to any point in time, I have the freedom to be creative.
  • Everything is centralized online and there aren't multiple copies floating around.
  • If I need to collaborate with someone on a project, I can easily share with them my code from GitHub.com, instead of zipping and sending them files. 
  • I now am confident with the basic understanding of Git. If I need to google something, I can understand and parse what they're doing. 
I've been using Git more assiduously now and avoid physically "save as"-ing my programs. It's been going great, and I feel a lot more at ease as a programmer. It's as if I've freed up my brain energy from figuring out how to save smartly and can focus on programming.

If you find yourself spending a good portion of your time save as-ing or returning to old versions of your documents, I would recommend learning Git or another type of version control software. It's definitely made my life easier.