[TUHS] What would early alternatives to C have been?

Larry McVoy lm at mcvoy.com
Tue Mar 11 01:46:56 AEST 2025


On Mon, Mar 10, 2025 at 11:27:46AM -0400, Dan Cross wrote:
> > [snip] creates pointless work for other people.
> 
> Along these lines, I can't stand when people write, `if (!strcmp(a,
> b)) { /* strings are equal */ }`
> 
> While true, I find the negation particularly annoying in this context,
> and prefer either `if (strcmp(a, b) == 0) { ... }` or writing a small
> `streq()` function that returns boolean true/false.

>From bitkeeper's style.h:

#define streq(a,b)      (!strcmp((a),(b)))

and

#define unless(e)       if (!(e))

Maybe I should post the whole file :-)


More information about the TUHS mailing list