batari, on Tue Jun 6, 2006 4:14 PM, said:
It also depends on what you program...
True enough. I tend to hit a lot more edge cases and do a lot more hexdumps than most programmers. You know you're out there when your physical calculator regularly overflows from the computations you're putting into it.
Quote
Even in C, there's little need for a calculator and basically none for a table.
Eh? What about RGB? The range for each number is between 0-256, which is 8 bits/2 nibbles. It's incredibly difficult to do those conversions in your head. Well, at least it is for me. Others might be much better at decimal -> hex conversion than I.
Quote
If you are writing a driver (or a compiler

)
...or a file system, an emulator, an operating system, a
compression/packing algo, an
FPGA design...
Um. Definite edge cases.
Quote
chances are you'll use lots of binary and bitwise operations. C doesn't allow you to specify binary, but you can specify hexadecimal, which can be converted to/from binary in your head without much thought since you only have to look at 4 bits at a time.
Indeed. However, I find it much faster to convert long strings using a calculator. Since I usually keep one handy, it takes me a lot less time to punch in 1100101011010001 and get a decimal or hexidecimal conversion than it does to do it by hand. The really time consuming conversions are in addressing. 0x2000000 just doesn't stand out as 32 megs to me, no matter how long I work with hex. I sleep, eat, and breath hex, but I never really relate hex and decimal in my head.
Speaking of which, I've always gotten a kick out of this
Blue Sky Ranger tale:
Quote
FUN FACT: While testing the game, Keith's boss Mike Minkoff kept getting access codes that ended in "69." Mike accused Keith several times of skewing the random numbers for an adolescent joke. Tired of being unfairly accused, Keith put the data stream 01000101 (the binary representation of 69) in the game's opening demo screen. He then told Mike, "Look, if I was going to put a '69' in the game, I'd put it right on the title screen!" and waited to see how long it would take Mike to notice. He never did; the game went out that way. 01000101 appeared on the demo screen, in the advertising, on the back of the box and in the instructions. When Keith finally pointed it out, Mike said, "But that's 45!" Mike is such a dedicated programmer, he saw the number in hexadecimal (base 16); he never made the final calculation that 45 (base 16) is 69 (base 10).
Edited by jbanes, Tue Jun 6, 2006 3:42 PM.