James said:
I fail to see how you can find out whether something is nonsense
by looking it up in the standard. (For that matter, the
standard is often "wrong", compared to the compilers I'm using.)
Case in point. Yesterday one of the developers ran into a problem with
a virtual function not being called. He was subclassing an object
residing in a library we are using. Had I not a decent grasp of the
language, by reading the standard, I would not have been able to tell
him exactly why it's broken and send the bug information to the library
developer allowing them to fix it that day. Granted, it was a rookie
mistake but knowing these things allowed me to say with absolute clarity
that it was this that caused it and not something else.
Most of it comes from communicating with collegues. I've
learned an awful lot from other peoples mistakes. And vice
versa, of course. My collegues learn from my code. Which is
one of the reasons why it's so important to make it readable.
Great, you learn from each other. Like I don't. I suppose none of you
step OUTSIDE your little circle either?
You like to call the areas where the standard is important "too near the
limits". Well, I've found it incredibly easy then to reach the "limits"
(as you call them) of C++. Why did my code work on one compiler and not
the other? Why, look in the standard and find I'm doing something
slightly wrong...or...the compiler I used originally was broken and now
the new one is fixed and my code must change...or, the compiler I'm
using is NOT compliant and I need to make a special case for it. These
cases are simple (template friendship, templates in general,
availability of member addresses) and often run into.
I suppose if you live in some happy, nonexistant la-la land where all
compilers are compliant then you don't have to worry about these things.
Tell me, how do YOU know which compiler is compliant without looking
at the standard?
Furthermore, the standard is the absolutely best reference for the
library that exists. The Josuttis book is a great tutorial but the std
is a much better reference. Standards compliance issues in production
code are also quite often involving misuse and misunderstanding of the
library. Nothing teaches a new programmer how NOT to do something like
being able to explain exactly why what they are doing is wrong, rather
than point to some tutorial book that says, "Don't do this." Short of
understanding the standard I see no other way to accomplish this.
Yet further, who says it's all MY code I have to understand?? Have you
never worked on something written by someone else? Have you never been
stuck trying to make heads or tails of some pile of spaghetti that some
lone wolf "expert" wrote? Guess you haven't since you never have to
look at the standard.
You can tell people that they don't need the standard all you want. I
strongly disagree. Your complaint that using the standard to make sure
code is compliant and to ascertain exactly what's wrong under certain
"limit" conditions is nothing but an opinion. I think it's a crock. I
suppose for those who don't care if they know C++ fully can get by
without the standard, but ANYONE that wants to develop expert level
knowledge absolutely needs it and every workplace should have a language
lawyer in it.
As to your insistence that my code, which you've never seen an example
of, would never pass review at your place of work...that's just a plain
ignorant statement. It tells me with absolute certainty that your
opinions are not at all based on fact or evidence but simply your own
thick headedness. It also tells me that, since you don't need the
standard, that standard compliance is not important at your place of
work and is not considered in review. It is certainly my opinion that
this should be a minor concern at the least (knowing full well it's way
too easy to write non-compliant code without knowing it until a compiler
upgrade or switch).
I'll let you know a little known secret: once you become so stubborn and
set in your ways that you can tell someone their code is shit without
even seeing it, your ability to learn anything new has become incredibly
limited. Hopefully you're correct in your assessment and have nothing
new to learn anyway. I doubt that very much though.