But there's also the appeal of the dreaded Incunabulum...
#define TYPE typedef
#define STRUCT TYPE struct
#define UNION TYPE union
Well, that's extremely opinionated. Which I guess is the point. It does seem to add a BASIC-ness to the code.However, when I see landmines like these:
#define TRUE (-1)
#define FALSE 0
I might just hide instead of touching it.I might just hide instead of touching it.
This code (the Bourne Shell source) is actually the reason why the IOCCC was created.
https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh
if (TRUE == expression)
{
...
}> Can you explain why?
Because it isn't how most C libraries expect true/false to be defined.
stdbool in C99 standardized things a bit, but before then what was generally accepted was:
> true is 1
> false is !true (Often 0 in practice).
Which means that any trivial:
if(true) { ... }
Won't work under Bournegol. Instead you _need_ to compare when doing an if statement.So the C-programmer is easily tripped up. False will work as expected, but True won't... All the time. There may be times it does work. Leaving the programmer throwing their hands in the air.
Except when being used as a comparison to any of the std utilities.