Tuesday, September 13, 2011

Happy Programmers' Day

There are 10 types of people in the world: those who understand binary, and those who do not.

Programmers, evidently, do not. Today is Programmers' Day, the 256th day of the year. The slogan for the date celebration is 1111 1111, binary for 255. Therefore, I believe yesterday should have been the date for celebration, not today. 256 is 100000000 in binary, two to the eighth power. Allow me to illustrate the problem.

# today (September 13, 2011)
bandarji > echo "obase=2;`/bin/date +%j`" | bc

# Yesterday
bandarji > echo "obase=2;`/bin/date +%j --date 'September 12, 2011'`" | bc

It could be this is a bug feature. That makes more sense to me than the claim, "Programmers count starting with zero." Regardless, happy Programmers' Day.

No comments:

Post a Comment