|
|
Subscribe / Log in / New account

A GNU C Library update

A GNU C Library update

Posted Feb 25, 2015 4:45 UTC (Wed) by zblaxell (subscriber, #26385)
In reply to: A GNU C Library update by madscientist
Parent article: A GNU C Library update

or even

#ifndef O_CREATE
#define O_CREATE O_CREAT
#endif

which is portable to any sane platform (i.e. one that hasn't already defined O_CREATE ;).

When I was 15 or so, I was out to fix anything that didn't fit into my view of the world as I head learned it thus far. All perceived defects were of equal importance. I had a library of stuff like:

#define IF (
#define THEN ) {
#define END }
#define AND &&
#define OR ||
#define CALL

because it let me write code like

IF x > 3 AND y < 5 THEN
CALL do_stuff();
END

which looked vaguely like the various languages I'd encountered prior to C, except with painfully wrong results when it was time to find out if x was equal to something.

This didn't help me read any existing code, and it meant nobody else could read mine, so I got over it--especially when it became clear just how important code readability was going to be. I think it's a phase many coders go through.


to post comments

A GNU C Library update

Posted Feb 25, 2015 18:32 UTC (Wed) by bronson (subscriber, #4806) [Link] (2 responses)

Steve Bourne went through that phase as an adult: http://research.swtch.com/shmacro

A GNU C Library update

Posted Feb 25, 2015 20:05 UTC (Wed) by proski (subscriber, #104) [Link] (1 responses)

It's odd he used "done" in the shell and "OD" in its source. So inconsistent :)

A GNU C Library update

Posted Feb 25, 2015 20:09 UTC (Wed) by zblaxell (subscriber, #26385) [Link]

If the octal dump utility existed prior to the shell, 'od' would have conflicted with it.

“&&” => “and”, "||” => “or”, “!” => “not”

Posted Mar 3, 2015 9:23 UTC (Tue) by ldo (guest, #40946) [Link] (2 responses)

These are standard in C++ and C99. In C, you have to #include <iso646.h>.

“&&” => “and”, "||” => “or”, “!” => “not”

Posted Mar 3, 2015 12:17 UTC (Tue) by mpr22 (subscriber, #60784) [Link] (1 responses)

Putting the primary content of your message exclusively in its subject line is... distinctly suboptimal.

But not as bad as starting a sentence in the subject line

Posted Mar 3, 2015 16:54 UTC (Tue) by jzbiciak (guest, #5246) [Link]

and finishing it in the body.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds