16 ms·
"Expert C Programming: Deep C Secrets" is a really good book to learn a lot of C tricks and quirks, plus some history. I read it a few years ago and loved it.
by tastysandwich 4y ago
"Expert C Programming: Deep C Secrets" is a really good book to learn a lot of C tricks and quirks, plus some history. I read it a few years ago and loved it.
I was a grad when I read it and remember annoying my older coworkers for a few weeks with little gotchas I picked up. "hey what do you think THIS example prints?" "Stop sending me these!"
- deleted 4y ago[deleted]
- jjgreen 4y agoFabulous book, includes a section "Bus Error, Take the Train" explaining the "bus errors" one found on Sun hardware ...
- defrost 4y agoWhen I wrote a lot of cross platform performant numerics I loved the bus error thrown by the Sun machines. In essence it was a RISC machine saying "I can't deal with unaligned data" and a sign that code was (say) storing a 32 or 64 bit int that straddled a word boundary and the hardware was not coping on a MOV. Why did that matter and why was it good thing? It forced programmers to think about data alignment and resulted in code that run faster on CISC Intel chips. The dirty secret about Intel chips was they "just did it" w/out complaint - and it slowed them down significantly on pipelined computations if they were constantly double handling unaligned data to get it from memory (across a word boundary) to bus (aligned for transit) to memry again (across a word boundary).