3 ms·
I think Pike's point about "thousands of needless lines of code" is that people do this: #include "foo.h" instead of this: #ifndef __FOO_H__ #include "foo.h
by mwcremer 16y ago
I think Pike's point about "thousands of needless lines of code" is that people do this:
#include "foo.h"
instead of this:
#ifndef __FOO_H__
#include "foo.h"
#endif
where "foo.h" looks like this:
#ifndef __FOO_H__
#define __FOO_H__
/* contents /
#endif / __FOO_H__ */
which in the former case results in having to lex foo.h in order to skip the contents.
However, as pointed out below, modern compilers will effectively do the same thing for you automatically.
[Edited to make the code readable]
- TheNewAndy 16y agoJust a quick pedantic point - __FOO_H__ is a reserved identifier (C90 reserved). You shouldn't be writing it in your code.