Only if you work with 8 bit bytes. Not always the case.
Happy Friday the 13th! It's Programmers' Day
If your code monkeys aren't answering their emails today, it may not be the curse of Friday the 13th, but instead because they've taken a day of rest to celebrate Programmers' Day. Programmers' Day is celebrated on the 256th day of the year, representing the maximum number of values in a byte – and 256 is also the largest …
-
-
-
Monday 16th September 2013 11:30 GMT Loyal Commenter
Re: A byte is always 8-bits
To out-pedant you, I think you'll find that although a byte is, by definition, always eight bits, a machine word is whatever size the machine is designed to work with. This might be 2 bytes, although there aren't that many sixteen bit architectures around these days, most modern machines being 32 or 64-bit. The machines I learned to program on were 8-bit, where a byte and a word were synonymous.
-
-
-
-
Monday 16th September 2013 10:35 GMT Anonymous Coward
Just picking a random couple of paragraphs...
...to pick upon...
>Programmers' Day is celebrated on the 256th day of the year, representing the maximum number of values in a byte – and 256 is also the largest power of two that comes to less than the 365 days found in a regular year. This means the holiday falls on September 13 most of the time and September 12 in leap years.
>Pedants might note that the binary representation of 1111 1111 is actually 255, making Programmers' Day 24 hours too late. But as any good programmer knows, this ignores the use of zero as a value.
"maximum number of values in a byte" - a byte contains one value, the maximum value that it can contain is 255, there are 256 values possible in a byte, they range from 0 to 255.
"ignores zero as a value" - the problem in misunderstanding is the use of numbers to do one of two things, count or reference. When counting, zero is always considered a value, the absense of the thing being counted. When referencing, there are one-based indexes (or indices, depending on the intensity level of your pedantry), and there are zero-based indexes. This is where the real problems began, especially the notorious 'off-by-one' and 'fencepost' types of errors so prevalent in developers who want to be programmers.
So, remember, there are only 10 types of people in the world...those who understand binary...and...those who don't...