E
Eric Sosman
Flash said:jacob said:Richard Heathfield a écrit :
Genius programmers like you should not use lcc-win32.
The better the programmer the less important the quality of the warning
since they are less likely to make the mistake [...]
This, I think, is not the case -- at least, it isn't for
me, although of course YMMV.
In the Very Old Days, I wrote programs by keypunching them,
wrapping the cards in a rubber band, and handing the deck through
a little window. Some hours later the deck would return to me
accompanied by a printout, and if I'd made some kind of foolish
mistake I had thereby lost one of my two or perhaps three daily
opportunities to try a compilation. Under those circumstances I
was *very* careful to desk-check before consigning my program to
its leisurely fate, because the "opportunity cost" of an error
was so very high. But nowadays? Pfui: I'll just dump a half-
written module through the compiler, knowing that it still has
errors but also knowing that the compiler will find them for me
faster than I would find them by eyeballing the file.
The gradual improvement in warnings has also made me sloppier
than I used to be. When I started writing C some thirty years
ago, I already had the luxury of fairly quick turn-around and had
begun to become less diligent about desk-checking my stuff. Yet
I soon learned that it was still necessary to be scrupulous about
certain parts of the language, one of them being the matching up
of arguments. The compilers of that day were perfectly happy to
accept `printf("d%\n", sqrt(x))' or `printf("%d\n", sqrt(x))' or
even `fprintf("%f\n", sqrt(x))', and it was only at run-time that
you'd get a clue something might be wrong. Quick compile-edit-
recompile cycles relieved some of the pressure to get things right
the very first time, but I was still maniacal about checking my
format strings, or more generally, my function arguments.
Then along came prototypes, and suddenly the compilers started
catching many of the errors I was still on guard against, like the
fprintf() above. And at more or less the same time, compilers
began to be able to diagnose the errors in the above printf()s, too.
And since I'm fundamentally lazy, I happily let the compilers take
care of these matters for me, and lost the rigid habits of my early
training. I believe that I am nowadays *more* likely to make some
kinds of errors (confident that the compiler will catch them cheaply)
than I was when I was less proficient (but operated without a net).
and more likely to be ale
to work out why there was a diagnostic. So it is actually
inexperienced/poor programmers who should avoid lcc-win32.
Agreed, on both points. Experience helps one to unravel a
baffling outcome, whether it be an obfuscated warning or a nonsense
output. When a warning is as poor -- as downright r-o-n-g, when
it comes to that -- as the one Jacob illustrated, a scarred veteran
will sort things out quickly but a neophyte will be nonplussed.
The beginner is, I think, better served by no warnings at all than
by bad ones -- at least, it worked for me.