5 Cultural Things You Should Know as a Developer
Rubber duck debugging
Have you ever wondered why there’s a rubber duck on your colleague’s desk? If there’s no tub in your office, it may be because he’s rubber duck debugging.
It has happened to all of us: you are stuck on a piece of code that you cannot get to work. You examine every line of code and still have no idea why it does not work. You go and get a coffee from the machine, hoping to get that moment of brilliance after returning to your desk. Ugh, it seems that’s not the case… at least not today. In a moment of despair, you raise your head and look for an idle colleague. If you are lucky enough, you spot one and ask him whether he can give you a hand to find the bug. He has not worked on that piece of code, so you start explaining to him every line of code. You try to explain every detail, every reason for every line of code, until…
You’ve found the bug. Your colleague didn’t say a word and you’ve found the bug. What has happened here? Why did the presence of your colleague help you find the bug? Well, you’ve gone through the basics of the code and explained every single assumption. When you were debugging it by yourself, maybe you skipped the basic parts in your reasoning, given that you already know the system. Maybe the bug was in one of those “obvious” parts. Now, why disturbing one of your colleagues if they won’t even say a word? Why not explaining every line of code to a rubber duck?
The idea of rubber duck debugging was first introduced in The Pragmatic Programmer, a university textbook about software engineering from 1999.
The Ballmer peak
As a developer, broadly speaking, we have two types of tasks: boilerplate coding and creative thinking. In the former, we barely have to make any decisions, just code an already-known data structure. In the latter, however, we need to be a bit more inspired and come up with a solution to a problem. Inspired… This is what the Ballmer peak (pseudo-)theory attempts to solve: it states that a blood alcohol concentration between 0,129% and 0,138% provides “superhuman programming ability”, enhancing our creative side!
As far as I know, the Ballmer peak was first introduced in Randall Munroe’s XKCD comic strip: The Ballmer Peak (ah, if you didn’t know XKCD… please add it to the list!). The Ballmer peak owes its name to Steve Ballmer, ex-CEO of Microsoft, and alleged discoverer of this effect. It has also been compared to the Yerkes–Dodson law, which dictates that “performance increases with physiological or mental arousal, but only up to a point. When levels of arousal become too high, performance decreases.”.
However, I don’t know of any scientific research that backs this theory up so I’m not encouraging you to try it, as your health and code quality may suffer!
42, the answer to everything
The Answer to the Ultimate Question of Life, the Universe, and Everything is… 42. At least that’s what Deep Thought, a supercomputer in The Hitchhiker’s Guide to the Galaxy, claims after taking 7,5 million years to get an answer.
However, Deep Thought claims that the original question is not known by anyone, and offers to design a supercomputer, Earth, that will provide the original question in 10 million years. Earth, however, is destroyed 5 minutes before giving an answer. The original question is later discovered to have been “what do you get if you multiply six by nine?”, although the computation of the original question may have been corrupted.
Anyway, why 42? There are different theories:
- 6 times 9 in base 13 is actually 42 base 13
- Its binary representation is 101010 which may, apparently, have different meanings.
- My favourite: 42 is the ASCII code of the asterisk *, used as a wildcard symbol in regular expressions.
Sadly, I’ll have to burst your bubble now. It seems that none of these theories is correct and the number was randomly chosen. It’s funny, however, to see the different theories that arise (I’m sure there are more) and the influence that it has had in the tech and pop culture. For instance, the famous 6 numbers in Lost: 4, 8, 15, 16, 23, 42 end up in… oh.
foo, bar, baz
I’m sure you’ve seen those names somewhere, at least the first two. Either as names of variables, functions, … The first time I saw them was actually in one of my first programming courses. Anyway, why?
It seems that the origin of foo and bar is the FUBAR term (later transformed to foobar), dating back to WWII. The names “foo” and “bar” would have been introduced in a programming context for the first time by the MIT around 1959 in the Tech Model Railroad Club (TMRC). In these models, there were different scram switches available in case of emergency. If someone hit one of those switches, the word “FOO” would appear in the display.
Baz, however, is less common. Earlier versions of this lexicon derived ‘baz’ as a Stanford corruption of bar. However, Pete Samson (compiler of the TMRC lexicon) reports it was already current when he joined TMRC in 1958. He says “It came from “Pogo”. Albert the Alligator, when vexed or outraged, would shout ‘Bazz Fazz!’ or ‘Rowrbazzle!’.
Bitcoin Pizza Day
May 22nd is commonly known as the Bitcoin Pizza Day. Why? That day, in 2010, Laszlo Hanyecz, a software developer who would have allowed GPU mining in Bitcoin, spent 10.000 BTC to buy 2 pizzas: “I’ll pay 10,000 bitcoins for a couple of pizzas.. like maybe 2 large ones so I have some left over for the next day.”. At that time, the Bitcoin project was just a bit over a year old, and 10.000 BTC were worth around 41 USD. At the time of writing, 10.000 BTC are worth over 117 million USD!
Even though the current conversion is an absurd amount to pay for 2 pizzas, this day is celebrated every year by the Bitcoin community, as it represented the first commercial transaction using Bitcoin. In fact, Laszlo Hanyecz has no regrets after 10 years: “It was a really interesting system but nobody’s using it,” he said. “If nobody’s using it, it doesn’t matter if I have it all.”.
… and that’s about it for now! What are other things you feel that every developer should know? Let me know in the comments!