I’ve often had discussions with programmers about the subtleties of the language. They believe they understand what a language keyword is supposed to do, and use it that way — but they’re often mistaken, or not fully informed.
I’ve started a list of C and C++ keywords that have subtle differences from the “common” understanding of their usage. I expect to add more: please add your suggestions below.
I’ve been fascinated by assembly language since I first learned to program: get really close to the hardware! However, there was still a small gap between those opcodes and what the hardware actually did.
When I went to Uni, one of the courses I took was to design a (simulated) microprocessor and implement an opcode map. I loved it – but it still wasn’t real enough.
A few years ago I stumbled across James Newman’s work with his MegaProcessor – a “micro”processor that had been implemented using transistors and LEDs instead of integrated circuits. And it’s big. Really big. Ten meters (thirty feet) big.
One of its nicest features is that one of its RAM banks is built as an array, to provide a display of the bits that the RAM contains. But that means it’s a pixel-addressable display, so I couldn’t help myself…
I wrote a (configurable) program to run on the machine, and sent it to James. He was kind enough to confirm that it worked on the real hardware – and even YouTube a couple of different runs:
A long (long!) time ago I answered a question on Stack Exchange, but it is still applicable today:
I’ve been working on PoE projects recently. The most important thing: getting a circuit done and tested that can be incorporated into a variety of projects.
This project was easy because there was no data: I just needed a raw power delivery system.
A while ago I edited the Wikipedia article on function pointers to explain an alternate syntax that I’ve used for years, but no-one else seems to. My way seems to me to be much clearer and more concise than the “canonical” one described in all the text books—so why isn’t everyone using it?
I’ve just assumed that it was lack of knowledge, so I’ve posted about C/C++ function pointers directly here.
And those articles offer solutions for the various deficiencies that apparently cause many programmers to not use them, citing (especially) code portability as a concern.