Why people don't read error messages, and Clang

WizenedEE:
I find it interesting that new programmers often don't read/understand error messages. I didn't when I was starting, and I just saw a thread where the error message was "class ... does not have member... " and someone had to point out to them that "no, the class does not have that member."

I think the big problem is that there's so much useless information surrounding the actual message, and the message uses cryptic terms.

Although I have gotten used to it by now, I also recently started using clang for a few projects, and it's quite a bit nicer. When I forget a semicolon as here:

        static unsigned int i = 0;

ostringstream toDisplay
                               
       toDisplay << getVolume() << " | ";
       XStoreName(dpy, DefaultRootWindow(dpy), toDisplay.str().c_str());



Instead of this with gcc:


sdwmstatus.cpp: In function ‘int main(int, char**)’:
sdwmstatus.cpp:214:9: error: expected initializer before ‘toDisplay’
sdwmstatus.cpp:225:49: error: ‘toDisplay’ was not declared in this scope




I get this with clang:


sdwmstatus.cpp:212:32: error: expected ';' at end of declaration
       ostringstream toDisplay
                              ^
                              ;
1 error generated.



with "error" red, the caret light green, and the missing semicolon dark green.

Not only is this more friendly to the new programmer, it's also more friendly to the seasoned guru who, even though she immediately recognizes that it's a missing semicolon error despite the message not saying so, still has to go to line 214 and look up and also read the next message and figure out it was caused by the first, rather than being shown exactly where the error is.

The current development version of GCC 4.8 has such messages. It hasn't been released yet, but it will be released in a bit. But until the Arduino developers decide to ship it, instead of a compiler that is 4 major releases out of date and was released on August 27, 2008, you won't see it as a user.