F
Francine.Neary
I was browsing through this on the internet (http://www.duckware.com/
bugfreec/index.html). I have to say, it seems pretty awful to me.
One example early on: he suggests using
#define CompilerAssert(exp) extern char _CompilerAssert[(exp)?1:-1]
for compile-time debugging, but this seems to me to be a bug in itself
- doesn't declaring a variable starting with _ provoke undefined
behavior by incroaching on the implementation's namespace?
And then he goes on to recommend using hungarian notation (yeuch!)...
in chapter 8, he says
"If you do not have access to a C++ compiler, use the standard C /* */
comment form"
implying he thinks it's a good thing to compile C with a C++ compiler!
And some of the advice is just bizarre:
"auto variables should be defined one per line"
(why? do whatever makes the meaning clearest. And is it OK to define
multiple static variables per line?), and
"using the comma operator can lead to code that is hard to read and
maintain. It is best to avoid using it"
- I often find the comma operator helps make code briefer.
The main problem seems to be that he wants to teach other people
style, while he has absolutely no taste himself - the following macros
speak for themselves:
#define LOOP(nArg) { int _nMax=nArg; int loop; \
for (loop=0; loop<_nMax; ++loop)
#define LLOOP(lArg) { long _lMax=lArg; long lLoop; \
for (lLoop=0; lLoop<_lMax; ++lLoop)
#define ENDLOOP }
Bring me the sick bucket!
In summary, I'd advise anyone to avoid this like the plague.
bugfreec/index.html). I have to say, it seems pretty awful to me.
One example early on: he suggests using
#define CompilerAssert(exp) extern char _CompilerAssert[(exp)?1:-1]
for compile-time debugging, but this seems to me to be a bug in itself
- doesn't declaring a variable starting with _ provoke undefined
behavior by incroaching on the implementation's namespace?
And then he goes on to recommend using hungarian notation (yeuch!)...
in chapter 8, he says
"If you do not have access to a C++ compiler, use the standard C /* */
comment form"
implying he thinks it's a good thing to compile C with a C++ compiler!
And some of the advice is just bizarre:
"auto variables should be defined one per line"
(why? do whatever makes the meaning clearest. And is it OK to define
multiple static variables per line?), and
"using the comma operator can lead to code that is hard to read and
maintain. It is best to avoid using it"
- I often find the comma operator helps make code briefer.
The main problem seems to be that he wants to teach other people
style, while he has absolutely no taste himself - the following macros
speak for themselves:
#define LOOP(nArg) { int _nMax=nArg; int loop; \
for (loop=0; loop<_nMax; ++loop)
#define LLOOP(lArg) { long _lMax=lArg; long lLoop; \
for (lLoop=0; lLoop<_lMax; ++lLoop)
#define ENDLOOP }
Bring me the sick bucket!
In summary, I'd advise anyone to avoid this like the plague.