more questions about efficient C code
Roy Smith
roy at phri.UUCP
Fri Jul 5 03:01:00 AEST 1985
> > > ... Any experienced C programmer recognizes this code
>
> if((fptr = fopen(filename, "r")) == NULL)
Somebody mentioned economy of expression being a good thing;
agreed. In this particular case the idiom is so well ingrained that I
don't think twice about it. In fact, doing it any other way would
require more thought.
Saving a line or two of source makes it that much more likely
that the entire 'phrase' will fit on your screen at one time, enhancing
comprehension. About the only time I would split the assignment and the
test is when the line would run off the edge of the screen otherwise.
--
allegra!phri!roy (Roy Smith)
System Administrator, Public Health Research Institute
More information about the Comp.lang.c
mailing list