Why C/C++ errors are SO obscure/devious??
- From: Massimo Soricetti <massimo_main@xxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 16:26:16 GMT
Hello,
I'm not a C newbie, but I'm teaching C programming (well... FIRST programming and then C) to other guys these days and it's driving me to some reflexions on the language.
It's not uncommon to forget a } writing code, and at compiling time get an error 18956778 lines after the mistake, in an otherwise absolutely correct piece of code. Or, sometimes in my journeys I got errors reported in a file, checked and found it correct, and discovered it was caused by an error in another file. And in general, I noted that many, if not all, error messages from the compiler are VERY short and cryptic, while a couple of words more could sometimes help a lot in understanding what's wrong and where, for newbies. Well, not only for them... maybe a compiler switch --NOOB_ERR_MSGS could be very handy for some people :o)
Why can't a compiler give more accurate informations about errors? Shouldn't this save time, stress and money?
Another example: have you ever met the error line "Multiple definitions of..."?
For example, why can't a compiler start a negotiation "on the fly" like this:
ERROR: Multiple definitions of <variable|function|method> X. X defined: 1) <here1> as variable <line of code definition...> 2) <here2> as variable <line of code definition...> 3) <here3> as function <line of code definition...> Choose which definition is the right one:
This is "interactive compiling", isn't it? Why not? Why the compiler can't simply ask us, in doubt, and on response modify sources accordingly on its own, in this case and in other similar? This would ease the programming effort a lot.
What are your opinions on this matter? .
- Follow-Ups:
- Re: Why C/C++ errors are SO obscure/devious??
- From: Ed Vogel
- Re: Why C/C++ errors are SO obscure/devious??
- From: Richard Tobin
- Re: Why C/C++ errors are SO obscure/devious??
- From: Chris Hills
- Re: Why C/C++ errors are SO obscure/devious??
- From: jacob navia
- Re: Why C/C++ errors are SO obscure/devious??
- From: Joseph S.
- Re: Why C/C++ errors are SO obscure/devious??
- From: Malcolm
- Re: Why C/C++ errors are SO obscure/devious??
- From: Ben Pfaff
- Re: Why C/C++ errors are SO obscure/devious??
- From: Emmanuel Delahaye
- Re: Why C/C++ errors are SO obscure/devious??
- From: Eric Sosman
- Re: Why C/C++ errors are SO obscure/devious??
- From: akarl
- Re: Why C/C++ errors are SO obscure/devious??
- From: John Bode
- Re: Why C/C++ errors are SO obscure/devious??
- From: Gordon Burditt
- Re: Why C/C++ errors are SO obscure/devious??
- From: Mark B
- Re: Why C/C++ errors are SO obscure/devious??
- Prev by Date: Re: object code from which compiler
- Next by Date: Re: Problem in Strdup()
- Previous by thread: understanding format specifiers
- Next by thread: Re: Why C/C++ errors are SO obscure/devious??
- Index(es):
Relevant Pages
|