9 comments

[ 3.6 ms ] story [ 24.1 ms ] thread
I heard some drag racers say that those not interested in motor engines, was the best drivers, because they just slammed the gas. I think that applies to programming too, if you know how the computer works you are more likely to do premature optimizations or write clever code. If you work with low level code its good to know asm. But you can be a very good, say JavaScript programmer without knowing arm assembly.
It’s not politically correct to know that more than just men are interested in engines.
This is a great resource, but if you just want to optimize a tight loop remember NEON intrinsics.
They aren't always as fast...
I find the treatment of binary numbers interesting.

I normally see it approached as "numbers are these abstract objects that can have different names, and different number bases are just different ways of naming the numbers; base two is handy for computers".

This approaches it as "binary is a representation of the state of switches. Oh by the way here's an equivalence relation between bit strings and the decimal numbers you know and love"

It's been so long since I've taught this to anybody I have no intuition about whether or not this approach is any better.

I find

"bit pattern would be

0000007b "

To be confusing, bit pattern to me would refer to the actual bits, because they are intrinsically relevant eg as flags.

But I'm not a clean slate, so I don't know. All I can say is I didn't have problems learning the 'usual' way.

I teach people that there are many ways to encode numbers into 0, 1 symbols (state of switches). One obvious way for natural numbers is base-2 (with more significant bits on the left). It get's more complicated with negative numbers (two's complement usually, but could also be one sign bit). Floating point numbers are hard. You could also use variable length integers where small numbers are represented with less bits and you use one bit to mark end of a number (every 8 bits).
Anybody know if I can use C.H.I.P instead of RPi to follow this book?