Why programmers should learn Git

Blog posts like this one are arguing that students should learn Git and I fully agree, but not for the reasons stated.

At the university level—we walk a fine line between theory and practice. We are not vocational schools and our job is partially to teach students how to think, learn and solve problems on their own. But students expect that we’re going to prepare them for a career in our industry—and at many levels we’re not living up to that expectation.

This tension between theory and practice and the issue of what Universities are for is certainly an interesting discussion, but I think in this particular case it’s compelety the wrong issue.

You see, when you learn Git you learn two things.

Thing A: The mechanics of Git, the commands, how to use them – things like push/pull, branching, rebase and so on.

Thing B: The workflow of Version Control – code management for team work, individual work and deployment. The freedom to experiment knowing you can always go back to a working version. Breaking problems down into smaller blocks and doing and finishing one thing at a time (ie. do one small commit at a time) instead of trying several things all at once and getting stuck.

When you teach students Git, you aren’t really teaching them Thing A. They should be able to teach themselves this. (If nothing else, 10 years ago SVN was an industry standard, now Git is one, in 10 years time maybe it’ll be Mercurial or something else we haven’t even heard of yet. Tools change.)

What you are really teaching them is Thing B. That’s really important, and the good habits that result from that take time to learn and get used to. Universities absolutely should be teaching good development practices.

This comment on Hacker News by klancaster hits the nail on the head.

One of the classes I teach is at the senior undergrad level, and they have been thrilled that I have them use version control. Many have commented that they wish that they had known about git in earlier classes, as it would have saved them when they screwed up their programs.

The students were grateful of the knowledge because it improved their workflow – in, other words, Thing B.

TL;DR: Students should be taught Git (or another Version Control) because they need to learn best practices for managing their work and their code.

ps. Not only students – if you’ve just taught yourself the mechanics of Git and your struggling to see why this is so important, you have probably only got Thing A. Try to learn Thing B and you’ll get it.

pps. This prompted by the blog post I quoted and also the fact I have ranted about Thing B to several people who were struggling at a hack weekend recently.

1 thought on “Why programmers should learn Git”

  1. I couldn’t agree more!

    Similarly, I think there’s too much emphasis on teaching people programming languages rather than how to be programmers. Once you’ve learnt/figured out the principles of programming you can pick up new languages and your skills are transferable.

    I’ve used Subversion and git, I’ll probably use whatever comes next!

Comments are closed.