Weekend Distractions: Learn Binary

I am inspired by a bit of advice from an old programmer. Since I’ve spent more than twenty years as a professional software developer (close to thirty years if you count high-school and university), I figure that I’ve earned the right to refer to myself as an “Old Programmer”. As an “Old Programmer”, I am required to do two things: first, I must dole out unsolicited advice; second, I must bore you with stories from the “old days”.

I’ll start with advice: learn binary.

There are only 10 types of people in the world: those who understand binary and those who don’t.

I’m not sure who deserves credit for this joke. All I know is that it isn’t me.

Whether you call yourself a software developer, software engineer, programmer, hacker, or whatever, you should know binary. I’ll be honest: I don’t use it all that often when I’m writing software. But it’s one of those fundamental underlying concepts upon which other fundamental underlying concepts are built. If you understand binary, you’ll understand why–while a kilometre is 1,000 metres–a kilobyte is 1,024 bytes. If you understand binary, you’ll understand why chmod 777 makes sense (an understanding of octal is a natural extension of understanding binary). Any old computer scientist can rattle off the powers of two well past 216; there’s a reason for that: powers of two have power in a world where a computer’s natural way of doing this is base-two.

It’s even been suggested–I believe by Carl Sagan (though I can’t seem to find a quote)–that we’d have invented computers a full hundred years earlier if we had eight fingers and thumbs on our hands. The base-ten math that we find so familiar doesn’t map all that well to a base-two world.

Speaking of base-two, the first computer-like thing that I ever owned was a Science Fair Digital Computer Kit sold by Radio Shack (Tandy). It was a pretty cool bit of kit for kid to play with (especially a nerdy one). I actually learned quite a lot about stringing two-state switches together with that thing.

That was in 1977. Yup: I’m old.

EclipseCon 2012

About these ads
This entry was posted in Cranky Old Programmer. Bookmark the permalink.

6 Responses to Weekend Distractions: Learn Binary

  1. Maarten Meijer says:

    And you should know instantly that 2^10 is approximately 10^3 when doing quick conversions

  2. Denis Roy says:

    chmod 777 never makes sense :)

  3. Bob D. says:

    Old is good.

  4. Robin says:

    > a kilobyte is 1,024 bytes

    That’s not really correct, the answer sadly is “it depends”: http://en.wikipedia.org/wiki/Kilobyte

    • waynebeaton says:

      @Robin: there’s always more to learn! I’m not sure whether or not I’ll be able to add kibobyte to my lexicon… :-)

      • Robin says:

        Yeah, “kibibyte” sounds a bit silly indeed. But the abbreviation “KiB” (or MiB) is not so bad and is already used by some software (e.g. the Transmission BitTorrent client, GNOME’s system monitor).

Leave a Reply

Fill in your details below or click an icon to log in:

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