Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I did try searching, but I did not see a similar question (either that or my search terminology was incorrect - if so, feel free to close).

I am an avid user of SO, and I notice that there are lots of references to the C++ standard in discussions and answers - and I have to admit, I have never read this particular document, the language makes my eyes hurt... So, the question is, can a C++ developer really code for a living without ever having read this document? Is it really important for us mere mortals who are not in the business of writing compilers?

share|improve this question
    
The persistence of the questions that are answered with brief quotes from the standard should be evidence enough that reading it is not a prerequisite for using the language... (provided you have somewhere to turn when you get stuck) –  Shog9 Feb 14 '11 at 22:12

9 Answers 9

up vote 14 down vote accepted

Nope - you can get along just fine without it

However, you'll have a much deeper understanding if you take the time to learn it. Perhaps follow the references from those questions that trouble you and learn a small chunk at a time.

share|improve this answer

If you want to argue about the language semantics and standardese, then the standard is very important. (I don't mean this completely derogatorily.) If you just want to get work done in the language (vs. on the language), then it is much less so.

The standard can make a decent reference to the standard library (not so much for the language itself) once you get a bit comfortable with it, but I'm hesitant to recommend it be used that way. Most people seem to do better with other materials. That said, I turn to the standard more often than not when I need to look something up about the stdlib.

However, reading the committee drafts and papers is one way to stay abreast of C++0x – in fact, one of only a very few ways, currently.

For SO and other forums, I hesitate to quote the standard except when it seems the poster would clearly and definitely benefit – perhaps they've asked for that or I think they're implicitly expecting it. In most cases, and especially with programmers new to C++, quoting it usually doesn't seem to help much.

share|improve this answer
    
If somebody wants to know what the language should do, the Standard is invaluable. If they want to know why the compiler does something, it's often very useful. For other questions, not so much. –  David Thornley Feb 14 '11 at 21:42
1  
@DavidThornley: It's hard to judge after so long being used to reading the standard myself, but it definitely seems most people find texts such as TC++PL more approachable even to find out what the language should do. –  Fred Nurk Feb 14 '11 at 21:45
1  
@Fred Nurk: Almost anything is more approachable than the Standard. I meant for answering questions on SO and the like, and wasn't clear about it. It adds a little authority when people are quoting cplusplus.com and other sources. –  David Thornley Feb 14 '11 at 22:04
    
@DavidThornley: I will very rarely quote sites like that (cplusplus.com in particular has too many problems for my taste), but for most posters on SO, they also seem more useful, even with errors, than the standard – and being easily available online is, unfortunately, a big part of that. –  Fred Nurk Feb 14 '11 at 22:10
    
@Fred, that's interesting to know, I've always thought cplusplus was a good reference (downside is their source of advertising - which is highly inappropriate!), now I'll have to remember to cross reference with the sgi reference. –  Nim Feb 14 '11 at 22:16

You should have it available for reference but I don't think anyone but its authors have read the whole thing...if they even did (they work in groups focusing on areas so I kind of doubt it).

The reason you should have it available is that sometimes a question about code correctness can only be answered by referring to the standard.

share|improve this answer
3  
In most situations you don't need it. What you need is covered in other books. Its only when you get to those corner cases or never used corners of the language that you need to check the definition in the standard (and usually there is an alternative to using the corner cases in the language). Leave the standard for the compiler developers and general developer can get along with other non formal texts. –  Loki Astari Feb 14 '11 at 22:02

It probably more important that you know where the standard is and know when to look things up.

If nothing else you should check periodically to ensure that you are adhering to the latest version and haven't let your code drift.

share|improve this answer

On a large team, you should generally have one (but usually no more) person who knows the standard at least reasonably well, so they can do things like settling any arguments/questions about things like whether particular code conforms to the standard's requirements.

Realistically, however, those answers need to be tempered by judgement and experience. The (current) standard says export is a keyword and tells what it does. In reality, it simply doesn't work that way with most compilers. Likewise, in a lot of cases, if you have three people disagreeing about some particular code and what the standard might say about it, that may be a sign that the code may need rewriting to be more straightforward.

At the same time, most teams will do most work on one platform, and having a standard (and somebody who's at least reasonably familiar with it) around to check that what you're doing isn't too closely tied to that platform can certainly be useful.

share|improve this answer
    
The "not more" is probably important - unless you want arguments between the experts on how to interpret the standard <g> –  Steve314 Feb 15 '11 at 13:56

I have been earning my bread as a C++ developer for about 4 years in total, without having read the standard. In fact, for the first two years or so, I haven't even read much else than C++ Primer by Stan Lippman and MSDN articles. So it is possible - in fact I fear that most of the people producing C++ code have not even read such fundamental works as Effective C++ et al. which I myself discovered only later.

IMHO to be a good C++ developer, one must understand the inner logic of the language(s) (as Scott Meyers notes, C++ is about 4 different languages) and the common idioms and pitfalls, and be ready to always learn more. Reading threads on SO can teach a lot about corner cases where in turn it may be worth reading up on relevant parts of the standard, if someone wants to really dig deeper. But reading the whole of it is probably rarely necessary for most of us.

share|improve this answer
    
Good point that there's essential books that are a lot more essential (to most programmers who aren't writing compilers) than the standard. +1 - but there's a fair number of "essential" books. –  Steve314 Feb 14 '11 at 21:06
    
@Steve314, indeed - starting to list them would not help answering this specific question though. But I added a link to the relevant thread on SO now. –  Péter Török Feb 14 '11 at 21:17
    
@Péter - nice touch, but my unstated point was that no one of the "essential" books is truly essential. Most C++ programmers should have read several titles from that list, but all of them? Unlikely. Even if you did, I doubt you could really retain all that knowledge. "Effective C++" is on my haven't-read-yet list, so I obviously count it as a less-than-essential essential book. –  Steve314 Feb 14 '11 at 21:25
    
@Steve314, I didn't mean one must read all of those - I haven't either, and some of them I read but wasn't impressed by :-) There is also some overlap between some of these, so it is a question of personal taste and chance which one a developer meets first and/or which one (s)he labels "essential". I believe the important thing is that there are some common idioms which are good to follow, and common pitfalls wise to avoid, and one should know about most of these, and the least painful way to learn these is from (some of) these books. –  Péter Török Feb 14 '11 at 21:34
    
Of course I won't really know how essential it is until I have read it. –  Steve314 Feb 14 '11 at 21:35

"Knowing the standard" is a matter of degree, and doesn't necessarily mean memorizing the original document.

A standards document is designed to be authoritative - not necessarily accessible. There are lots of one-step-removed sources that are much more accessible. True, there's a bit of Chinese Whispers in that, but it's rarely a big issue - certainly at the one-step-removed level.

Full disclosure - I'm bound to say this - I've never read the standard. Though I probably will make the effort to get the full C++0x document when it's finalized.

EDIT of course if Stroustrup releases a new edition of "The C++ Programming Language", I may settle for that again.

share|improve this answer

When I programmed in C++, I often referred to the language standard for information about standard library functions. The C++ standard library is quite large, and I found the language standard to be the most convenient source.

share|improve this answer
1  
wow really? I always find online resources such as cplusplus indispensable in this sense... –  Nim Feb 14 '11 at 21:53

I could have sworn I've answered this question before, but I can't find it. Basically, C++ is unlike Java in that it's intended to have holes in the specification other platform specifications can fill (e.g. POSIX, or your architecture's ABI specification, or your compiler). Thus, when answering questions on sites like StackOverflow, it's common to bring up the specification to indicate that just because something works on one compiler doesn't imply that it works everywhere. In other words, a lot of the reason for referencing particular specifications when working with C++ is to clarify exactly how portable a particular use of the language is.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.