by pjc50 · 8y ago · 0 comments
There are a lot more risks in C than more recent languages. Koenig's book "C Traps And Pitfalls" https://www.amazon.co.uk/C-Traps-Pitfalls-Andrew-Koenig/dp/0... was extremely useful to me when I was learning the language (available at my local library!). I don't know if there's a more modern version that takes into account recent changes to the C standard.
I note that a lot of the time in embedded work you don't get to use the latest version of the standard because you're using a weird or obsolete toolchain that doesn't support it. Or architectures like PIC, where your stack is hardware limited to 8 levels and indirect addressing is inefficient.
I think a lot of the "pure C" people are disguised as electronics engineers - doing PCB design and microcontroller programming together.
But to be fair, can't that be said that nearly everything is self-taught? From Physics, to mathematics, to music performance and theory, to learning to ride a bicycle or drive a car -- we can read but it takes some time to internalize the structure of each discipline and "own" it.
>>in embedded work you don't get to use the latest version I work in C77, and I'm reminded of how far C (and C++) has come each time I have to #define that fancy new-fangled "boolean" type.
>>I think a lot of the "pure C" people are disguised as electronics engineers... Agreed, this is exactly right. Most if not all of the pure-c world is due to embedded micros with strict limitations (<1k RAM, etc.)
Do you mean C89? I've never heard of C77 and a quick Google search came up with nothing.
Although ANSI C wasn't a thing until 1989, the language had been around since 1972.
The original K&R book was published in 1978, and if you read it, you'll see C that's noticeably different from C89 or newer. 'C77' was probably just a fun bit of shorthand pjc50 used to describe old, K&R style C. Or at least C that's missing some ANSI features.
Let's say that is true. The bottleneck is more about how much you can dedicate to the learning. You run out of time eventually.
I won't link to it directly; instead, the open directory (which lists a pile of other PDFs) is https://doc.lagout.org/programmation/C/.
If there's one thing my CS program did correctly, it was having a two semester course (sort of, officially they were two separate courses) that covered an intro to C programming but also C in terms of machine architecture, down to learning to disassemble C or assemble it from assembly, etc.
I think it was fairly valuable at the time to learn how and why C is important/forms the lowest layer for 'modern' languages.