Reminds me of an intro to programming book in German that I once had, covering different styles from imperative to OO. Not even that old, late 90s I guess. But I guess the author just had to use C, even if he'd have preferred Pascal. So the very first thing the book does is introduce a boatload of preprocessor macros to make it look like Pascal. A weird way to start out if you had some prior C experience…<p>Then again, for short academic programs it probably won't cause that much confusion, having running code is more a side-effect of that, so it's a bit like executable pseudocode.<p>It does make me wonder what's the biggest program out there that's been written with heavy preprocessor abuse. Then again, not sure whether I'd really wanna know…
I thought it was amusing until I read that:<p><pre><code> #define LOBYTE 0377
#define STRIP 0177
#define QUOTE 0200
</code></pre>
I can deal with preprocessor abuse but octal crosses the line...<p>Also, in case anybody would have the bad idea to take inspiration from that code, don't do that:<p><pre><code> #define MAX(a,b) ((a)>(b)?(a):(b))
</code></pre>
It evaluates the macro parameters twice.<p>Although, on second thought, don't do anything like that code anyway.
This is an interesting sort of forerunner to another topic in yesterday's HN [1], Cello [2], which appears to be essentially a more thorough, and better-grounded version of Bournegol.<p>[1] <a href="https://news.ycombinator.com/item?id=8799070" rel="nofollow">https://news.ycombinator.com/item?id=8799070</a><p>[2] <a href="http://libcello.org/" rel="nofollow">http://libcello.org/</a>