Mail Archives: djgpp/1996/05/30/01:38:02
Reply to message 4534148 from FREDEX AT FCSHOM on 05/28/96 2:07PM
>[EDITORIAL-MODE-ON]
>Treating main() as if it were a void function is a bad habit which is
>discussed (complete with flamage) almost weekly in comp.lang.c. It seems
>to be perpetrated by ill-informed high-school and/or college instructors,
>but even more so it is perpetrated by ill-informed authors of poorly
>written books, one of the most notable culprits being Herbert Schildt.
Hehe. I think I'd enjoy the discussions in comp.lang.c then. :) I even had
such a C instructor last semester. Fortunately, I already knew enough that
I didn't fall for it. I also dislike intensely the practice of defining main
like this:
main()
{
...
};
Sure, not declaring a return type defaults to int, and not declaring any
parameters defaults to void, but is it really THAT much more work to
define "int main( void )"?
I am well aware that that would not work under traditional C. But the
ANSI spec is so well-rooted that deliberately writing unclear and
unsafe code just to satisfy the few remaining bastions of ignorance
among programmers is just plain silly.
>[EDITORIAL-MODE-OFF]
John :)
- Raw text -