# why do programmers confuse halloween and christmas

БWhy do programmers always mix up Christmas and Halloween. б Because Dec 25 is Octб 31Б
Get it? б If you do, then you should probably stop reading here because this is likely to be old news to you. б If youБd like to know why itБs so damned funny, and learn a little computing basics for good measure, read on! If youБre not a programmer, you (hopefully! ) recognise the abbreviations for December 25th (Dec 25) and October 31st (Oct 31), and (hopefully!! ) recognise them as Christmas and Halloween. б So far, so good, but not very funny even to a programmer. To a programmer, the abbreviations БDec 25Б and БOct 31Б can also mean something entirely different. б Dec 25 is an abbreviation for БDecimal 25Б and БOct 31Б is an abbreviation for БOctal 31Б, and for reasons that IБd like to explain, these are exactly the same thing. To see why, letБs start at looking at the normal decimal number system the number system we use in day-to-day life. б Decimal is simply a way of counting or more precisely, of representing, numbers in blocks of ten. б In day-to-day use we use the arabic numerals 0 through to 9 to represent the English numbers БzeroБ through to БnineБ. б After nine, we start counting in units of ten, so ten is 10, eleven is 11, twelve is 12 and so forth. б After ninety-nine, we start with another block of 10, so hundred is 100, one-hundred and one is 101 and so on and so forth.

This is, of course, fairly elementary stuff itБs the kind of thing weБre all taught in primary school. б As an aside, this, unfortunately, is also one of those things that everyone knows so instinctively that they stop thinking about how numbers work. б 10 is ten. 12 is twelve, and thatБs all there is to it. б ItБs so ingrained that itБs easy to forget what an inspiration the arabic numbering system actually is and how out of kilter with our actual counting system it is. Okay, so when we say Бtwenty fiveБ, we write out the arabic numerals 2 and 5, representing 2 x 10 + 5. б When we say Бthirty oneБ, we do the same thing: 3 x 10 + 1. But why stop at 10? б Why should the arabic numerals Б31Б necessarily represent the number thirty-one. б What if for reasons that I will shortly explain I want each column to represent a multiple of a different number? б What if I wanted each column to represent multiples of 8? There is absolutely nothing stopping us from doing that, and that is precisely what Octal is. б In Octal, the numbers zero through to seven are represented in the normal way: 0, 1, 2, 3, 4, 5, 6 and 7. б When we get to eight though, things get slightly skewed. б Eight in Octal is represented by the arabic numerals 10. б Remember, each column is representing multiples of eight, not multiples of ten; so 10 is Octal is 1 x 8 + 0 Eight. б And we carry on from there: nine is 11, ten is 12, eleven is 13, and so forth 20 is sixteen, and 31 is 3 x 8, which is 24, plus 1 which gives us twenty five. (Incidentally, I bet youБre reading that and your mind is reading it as, Бso ten is [twelve], eleven is [thirteen] and so forth. б Try to think of each arabic numeral as an independent figure: Бso ten is [one, two], eleven is [one, three]Б) So thatБs the joke in a nutshell:б to a programmer, the number represented by the arabic numerals Б25Б (two, five) in decimal is the same as the number represented by the arabic numerals Б31Б (three, one) in octal, because 2 x 10 + 5 is the same as 3 x 8 + 1. б ItБs simply an amusing coincidence that, to the programmer, Dec can mean both БDecemberБ and БDecimalБ, and Oct can mean both БOctoberБ and БOctalБ; and that Dec 25 is just happily, and coincidentally, Oct 31.

But thatБs not a truly satisfying answer; the obvious question is why would anybody want to do that? б WhatБs the point?

If 10 is БtenБ, then why would anyone find any use in 10 being БeightБ? б We all have ten fingers, itБs easy to count in tens, so why change things and count in eights? The answer lies in how computers store numbers. б Computers, you see, donБt count in tens. б Computers count in БonБ and БoffБ. Welcome to! Guidelines and Information Offensive jokes are fine as long as they are still jokes. We do make exceptions for extremely offensive jokes. Keep the comment section civil and light hearted. Personal attacks will not be tolerated. If you want to be a dick, go to Jokes must be in text format, no linking allowed. (YouTube, Imgur, etc) Reposts will be removed at our discretion. If you post a NSFW image/link in the comments, it must be tagged as NSFW (Nudity/gross images) or NSFL (Gore/extremely disturbing images, and only if relevant to the conversation) These are jokes. Some of them are old, and as such reflect the tone of the times. Some of them are new, and just as offensive. Unless it s spam, it stays. If you find certain comments or submissions here offensive, the best way to address it is with more speech.