views:

526

answers:

11

Whenever I follow C++ related IRC channels, I see folk giving each other C++ papers' standard's links to come to a decision on ongoing discussions, since they all boil down to standard, naturally. However, those papers are rather boring and hard to read. How do you manage to read those bloated papers? and Is reading those papers inevitable to learn C++ thoroughly? I have just run into a similar statement in a recent C++ article:

But before you can use its awesome powers, you just have to wrap your mind around one little detail: C++ isn't a programming language; it's a worldwide research project running about in disguise.

Here's the lowdown. Reading compiler manuals will only get you so far. The bulk of C++ is documented in papers, presentations, and (most importantly) the experience of its users.

+18  A: 

However "boring" and "hard to read" language specs may be, for readers with a decent understanding of the language already, they have a lot of valuable information that can bring a great deal of clarity.

Repeat after me: "Specs are good."

Alex Fort
+8  A: 

C++ is more than a language, it is a state of mind. Would like to see yourself sacrificed at the alter of the Committee for you sinneth by not reading the Holy TRs?

However, those papers are rather boring and hard to read.

No they are clear, concise and brief. That is the hardest part.

How can you bear reading those bloated papers?

Habit.

and Is reading those papers inevitable to learn C++ thoroughly?

Yes and no ;)

dirkgently
Habbit -> Habit. :-)
Jweede
+5  A: 

I don't actively read many standards because ... it's usually pretty boring. 90% of it is pretty obvious. After all, it benefits a language for the majority of use cases to be obvious.

My biggest use for a standards paper is figuring out weird behavior or behavior that goes against what my instincts say. Standards are invaluable for disambiguating these scenarios and giving a clear reason for the behavior.

Most of the time I've ever picked up a standards document it was to answer a question I had about a particular piece of code (many times for SO ; )).

JaredPar
+3  A: 

What part of the word "standard" you don't understand? It is a matter of agreeing on something, just like a contract. Can you read the mortgage papers you sign? It's boring but you better read before you sign.

Otávio Décio
^^same as above^^
Samuel
+1  A: 

The definitive resource on C++ is generally considered to be "The C++ Programming Language" by Bjarne Stroustrup. It describes in minute detail the language as well as the STL. It is well worth the read.

While you can learn a language without going to it's original source (Book, specs etc.) it is unlikely you would ever be able to master it.

tremoloqui
TC++PL is a good book, but it's known to correct errors. The _definite_ source is most certainly the ISO C++ standard.
Pavel Minaev
+1  A: 

Of course you do not go to the standard or to the papers proposing additions to standard to learn the language. Use an appropriate set of texts, tutorials, etc. to learn a language.

At some point, you might reach a level of proficiency and/or interest in the language where you need to be able to understand some of the more obscure points of the lanaguge. At that point, you will need to be able to read and (hopefully) understand the standard document.

However, you may want to have a copy of the standard available to you to refer to even while you're first learning the language. There will be times when a discussion online or in a tutorial text will refer to the standard, and it might be helpful to actually read the standard text. Note that slogging through the standard can be boring, difficult, and often incomprehensible. Don't worry too much at first about being able to understand everything - over time, with experience and multiple readings, it will become easier.

For pointers to where to get the standard, see http://stackoverflow.com/questions/81656/where-do-i-find-the-current-x-standard/83763#83763

Michael Burr
+1  A: 

I've never sat down and read the entire standard front-to-back, but I must have referred to 1000s of times over the years. The best way to use it (IMHO) is as a reference, and the best fprm to own it in the PDF version, so that you can search it easily. It is certainly not, and does not aim to be, a tutorial.

anon
+1  A: 

The only time I read the C++ standard is actually when somebody asks a particular C++ question in a forum like this. E.g. "If so and so is legal".

The compiler documentation is what I refer to in my working environment. It doesn't really matter for me if a feature is mentioned in the standard - if it is not implemented in the compiler I can't use it anyway. Also more often than not if there is something that doesn't work it is often not the compilers lack of C++ std compliance that is the problem but some programming error from me.

OK once in a blue moon I do take a peek in the standard, but normally not due to some problem at work but more out of curiosity. :)

Anders K.
"It doesn't really matter for me if a feature is mentioned in the standard - if it is not implemented in the compiler I can't use it anyway." - the problem is usually the other way around - just because your compiler allows it doesn't mean that it's legal by the Standard (and hence portable). When portability matters, you have to look up the standard every now and then.
Pavel Minaev
True, although in my case up until now portability hasn't been a requirement.
Anders K.
+1  A: 

I have read C++ standard and proposed papers, and I can very well agree on them being quite unreadable, e.g. compared to the C standard. You cannot read the C++ standard without constantly coming across concepts that are defined elsewhere and that you then have to look up (and whose definitions refer elsewhere). Additionally the language is very formal (mathematical), instead of what a programmer or an engineer would write, further obfuscating it.

Tronic
+1  A: 

Actually I don't find reading the standard boring. Obviously you must not expect a tutorial or a "guide".

They are usually helpful (once you reach a good enough knowledge of the language) to understand why something is designed in a certain way, which could be different from your original expectation. And they provide examples.

What I find annoying is the distance between actual compilers and the standard :-)

Francesco
+1  A: 

You don't normally read the standard document like you'd read a book. The standard is a reference source. You need to familiarize yourself with the basic standard terminology and with the way the document is organized. The point is to learn to find your way in the document, so that you can always find the answer to the question that concerns you in each particular case. After a certain period of time, you'll become so familiarized with the document that you'll know the answer right away or at least you'll know the place (or places) in it that contains the material you are looking for.

AndreyT