views:

252

answers:

6

Whenever any question is asked, and a reference text is needed, I never see MSDN C++ Language Reference being referred.

I was browsing through it and I personally feel that it is extremely well written.

Is there some specific reason it is not used as often as a standard?

Is it because it contains some VC++ specific features?

+8  A: 

I believe it's because those of us referencing a reference reference the actual standard itself.

Billy ONeal
Although the actual standard is not on line but drafts of the current and next one are
Mark
This. If you want a definitive source on C++, use ISO 14882:2003. MSDN may be reliable, or it may not, but it's not authoritative.
Derrick Turk
@Derrick Turk: this ISO 14882:2003 C++ standard is not free of cost! I didn't expect this.
Lazer
@eSKay: true. It's fairly cheap though, I think $18 from ANSI (or $30, can't remember, got mine through work). FYI the drafts are available for free from open-std.org and the draft immediately prior to adoption of the '03 standard should be Pretty Darn Close (tm).
Derrick Turk
Links to various standard documents: http://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents/83763#83763
Michael Burr
+2  A: 

Is it because it contains some VC++ specific features?

I think that's the basic reason. For example, it often contains info on C++/CLI, not just C++.

VC++ 2010 reference, I think, is careful in distinguishing which part is in the C++ proper and which part is in the C++/CLI. But to refer to the standard, of course it's better to refer to the standard itself. VC++ documentation refers to the standard quite often, too.

Yuji
A: 

One interesting example: just look at all those __XXX keywords!! (The C++ standard has none)

Rooke
@Rooke: hmm... confusing. Though the page does say `Names with leading underscores are Microsoft extensions.` on top.
Lazer
That's because the standard reserves them for implementers... (_xyz and __xyz)
conio
@conio: _xyz is only reserved at the global namespace.
Dennis Zickefoose
@Dennis: if you want to be precise (also known as "nitpicking"), they are reserved in both the global namespace and ::std namespace, unless the first letter following the underscore is a capital letter - in that case they are reserved everywhere (§17.4.3.1.2). In any case, Rooke mentioned keywords beginning with two underscores, and those are reserved everywhere always.
conio
And just for kicks, [IBM keywords](http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/cplr126.htm), [Sun C++ documentation](http://dlc.sun.com/pdf/820-7599/820-7599.pdf) (you'll have to search the PDF for underscores), [Intel C++ for Windows keywords](http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/compiler_c/cref_cls/common/cppref_keyword_overview.htm), and so on...
conio
+2  A: 

MS has been pretty good about making clear which parts of the document are MS specific or not, so I agree that the MS references are pretty good (particularly if you're interested in MS extensions).

I generally refer to the standards docs if I'm looking for information about "what's standard" because:

  1. I have them (see http://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents/83763#83763 for links to how to get yours)
  2. they're PDFs which I find easier to search and read than the web-based or Windows Help-based MSDN docs
  3. they're definitive (as far as answering questions about the standard)

The biggest drawback is that I don't have an electronic version of the C90 standard, yet..

Michael Burr
+3  A: 

The answer is fairly simple: The MSDN reference is not authoritative. It tells you how Microsoft's compiler behaves, and yes, it usually happens to coincide with what the standard says. But when someone asks how the C++ language deals with some situation, only one text has any authority: the ISO standard.

So when answering questions about C++, people tend to reference the standard. If you ask specifically about how MSVC implements it, then MSDN would be a perfectly valid source. But most questions are simply about C++.

Or to put it another way: if MSDN contains a typo, then MSDN is wrong. If the ISO standard contains a typo, then that's how the language is defined.

jalf
A: 

The C++ Standard defines how the C++ language works, the Microsoft C++ Language Reference defines how Microsoft's implementation of that language works.

So if you want to know what behavior is guaranteed independent of the compiler, The Standard is your guide. Some details and certain corner cases are left to be implementation-defined there and every implementation can define extensions to the language, so if you want to use those MSCV specific properties Microsoft's Language Reference should explain them.

Most SO questions on C++ on don't explicitly ask for a MSVC specific answer that might not be true for other compilers. So referring to The Standard gives an general, compiler independent answer, while the MS Language Reference wouldn't hold much weight for anything else than MSVC.

sth