Archive for May 2007

In Praise of Git, the Greatest System Of Its Kind

May 18, 2007

I’ve been putting off my second attempt at this essay for awhile. But recently I came across a YouTube video of Linus Torvalds explaining his Git version control system at a Google Tech Talk.

It’s kinda funny because Linus likes to use a lot of tongue-in-cheek hyperbole. He called the CVS the devil, Subversion developers morons, and had some fun banter with Google engineers who use the centralized model in Perforce which he insisted can never work as well as a distributed model.

I’ve tried and failed to explain to the world what is special about Git. I was encouraged to see Linus himself have some trouble also. It’s not that I’m a failure, this thing is just hard.

But it isn’t so different from a lot of other hard to explain things.

Say you just learned Ruby on Rails, you made your first little Rails website in record time, and you’ve just got to tell your co-workers about this fantastic Ruby thing.

While you wait for Eclipse to start, it looks a lot less shiny today, you head over to the break room and attack your first target coworker. And as you launch into your first explanation to the incredulous, words fail you. How do you explain to the newly hired former J2EE consultant that not having config files and hard coding everything using a special convention is more flexible? Words fail because you sort of have to have been there and consumed enough kool-aid to see where these nut jobs were coming from. And they were right! Dead right!

How do you explain enlightenment?

Maybe you just learned Erlang and it’s your new hammer. Ready to convince your boss to let you try it in anger?

It’s hard to explain to somebody what a fun party it was because, well, if they weren’t there, they weren’t there. And if they weren’t there, they didn’t experience first hand all that fun. No enlightenment for them.

But I’ll try again. My first attempt failed, but I think I’ve learned better this time.

First I want to talk about SpongeBob.

There’s this episode of SpongeBob where his boss makes he and Squidward work 24 hour shifts at the fast food joint. SpongeBob can’t get enough of being a fry cook and pesters Squidward mercilessly for the whole night. “Hey Squidward, I’m cleaning the bathroom… at night!” “Hey Squidward, I’m polishing the tables… at night!” Or whatever.

And how many times have we seen some stupid blog meme like this: “Hey Internet! It’s Ruby program for… the Y combinator!” “Hey Internet! It’s a Perl program for… the Y combinator!”

Or maybe it’s a language: “Hey everyone, it’s a wiki… in Haskell! It’s a weblog.. in Haskell! It’s a stupid blog post… about Haskell!”

Or the much maligned: “Hey Internet! It’s a scheme implementation of… FizzBuzz!” “Hey Internet! It’s full J2EE stack implementation of… FizzBuzz!”

All these little toys flying around the Internet, and here’s where I try to get back on track. I’ve heard some folks cursing the fact that so much energy is being wasted on mere toys, when we could try and get some real work done.

I think something was lost with CVS and Subversion. Torvalds points out that in his not so humble opinion, CVS and Subversion are inferior to just passing around patches and tarballs. And here he isn’t being tongue-in-cheek. He really means that.

How could that be? When all you have is a mailing list and patches, even the core developers of a project have to communicate their code on a mailing list, and in little mail sized bits.

What’s outrageously cool about the whole thing, is real work degenerates into little memes.

“Hey look at this patch, it’s a new filesystem that twice as fast as the old one!” (see series of 6 patches)

“Hey, I increased your performance by 10% with this modification.” (Patch sent in reply to patch 2)

“Hey, that’s cool, but you missed a case and could corrupt unless you handle this.” (Patch sent in reply to patch 5.)

What I’m getting at is it’s that silly SpongeBob, “Hey Squidward!” behavior, but it gets real work done. Where CVS and Subversion go wrong is that they make it convenient for core developers to skip that step.

The core developers lose out on code review, and more importantly, on that stupid code banter. Stupid code banter is a fundamental human need.

Why would sane people post FizzBuzz implementations on the intarweb? Because code banter is required for human sanity. Once CVS and Subversion got popular everyone forgot the natrual way to bat code around, and had to turn to artificial drugs, Y and FizzBuzz.

Git comes from this guy and his friends who, in their isolated kernel world, never forgot about the fun of batting code around, and how you can harness it to get real work done. They saw early on that it’s 10 times more fun to review code before the flaws are petrified in in a subversion trunk. That’s the real lesson.

… in my not-so humble opinion.

Barely sane people deprived of natural cleansing code banter.

What one example of real code banter looks like.

Another one, showing you don’t have to always mean it. Notice it’s “untested.”

Now, doesn’t that look more fun than fizzbuzz?