5 ms·
I hate non-standard length binary numbers! Just write 01100100 for God's sake... On topic, Shannon is my favorite scientist of the last century, after von Neum
by Cyph0n 11y ago
I hate non-standard length binary numbers! Just write 01100100 for God's sake...
On topic, Shannon is my favorite scientist of the last century, after von Neumann of course. If his only contribution was connecting Boolean algebra to digital logic, he would have been a pioneer. But no, he goes ahead and defines information theory out of nowhere, even though the majority of applications that can utilize it were not yet practical! I mean, come on Claude!
- Colin_M 11y agoYeah, especially since 01100100 can't be misinterpreted as -28
- Stratoscope 11y ago01100100 has been misinterpreted as 294976 though. I suppose we can rely on context to choose the correct interpretation, as Shannon is unlikely to have been born 294,976 years ago or 28 years in the future.
- jloughry 11y agoFunny, I saw it and thought 'hey, seven bit ASCII---how appropriate'.
- svantana 11y agoDo you also prefer "standard" lengths of decimal numbers, and if so, what are those? On a related note, I once had the weirdest bug in a C program that I couldn't figure out. It turns out that I had stylized an array of integers with preceding zeros, like: {025, 057, 112} to make it pretty. Little did I know that those zeros made the numbers octal!
- Cyph0n 11y agoWith binary especially I feel it's easier to read if the number is written out in nibbles. Besides, many of us were introduced to binary through ASCII, so the 8 bit format feels even more natural imo. Oh damn, that must have been tough to find!
- B1FF_PSUVM 11y agoAh, the oblivious tyranny of the victorious 8-bitters. The days of the 6-bit register or the 18 or 36 bit words are gone, dust beneath the heels of the conquering hordes of the 8008 microprocessor heirs.
- Natsu 11y agoYes, I do prefer standard lengths of decimal numbers. With decimal numbers, we break every group of 3 up with a comma. It's much easier to read 1,000,000 than 10000000, after all. If you disagree, I hope you noticed that I wrote two different numbers (1 and 10 million). So I prefer if you break up binary numbers on either 4 or 8 bit boundaries with a space and leading zeroes, as is very common in hex editors. So I'd have written either 01100100 or 0110 0100, either of which would be easier to interpret.
- jacobolus 11y agoUsing an initial 0 to indicate octal is a terrible convention. I’m very glad that Python 3 makes 0123 into a syntax error, and uses the form 0o123 instead for octal literals, to match the style of 0x53 (also adds 0b1010011 for binary).
- Tiksi 11y agoI wonder if there's a reason for keeping the leading 0 there past tradition/convention. 0x as a prefix makes sense to differentiate between 0x12 and 012, but if it's 0x 0b and 0o, imo it'd make more sense to drop it and just leave it as o12, b12, x12, etc.
- MaxGabriel 11y agoo12, b12, and x12 are all valid variable names
- Tiksi 11y agoYeah... not sure how that slipped my mind, seems quite obvious now. Thanks
- deleted 11y ago[deleted]
- chj 11y agoI prefer the Scheme way: #x53, #o123, #b1010011 It feels more natural to my taste. We already use #1, #2, ...
- justifier 11y agoyour displeasure only illustrates the limits of your interest there are a number of areas of inquiry where using 1100100 is more appropriate than 01100100 and considering here it is being used to represent an age, one would have to show a spec on ages represented in binary to determine what 'standard' is
- Intermernet 11y agoAt least we can assume that age is unsigned...
- justifier 11y agofor now :p