Talk:C++/Archive 1

message: The page for C++ is well intentioned, but needs massive revision and expansion by someone who knows the language well.
I will be revising this article shortly.  (I have already submitted two minor corrections.)
----
===Technical Overview Changes===
[The Wikipedia really needs ChangeLogs; maybe it has them and I'm just a newbie.]
I'm STL, by the way.
My changes addressed these issues:
1. The language itself, and not a given C++ program, consists of the Core Language and the Standard Library.
2. The Standardization Committee talks about the Core Language without scare quotes; thus, they should not be used here.
(I like to capitalize Core Language, but that breaks the wiki-link, and since the capitalization isn't always used, I am content to leave it uncapitalized.)
3. The mention of "organized into statement blocks" was irrelevant and in any case is linked from the core language page.
4. Mentioned how the mighty C++ Standard Library contains the STL and the C Standard Library.
5. Removed the assertion that the C++ Standard Library is written in "core C". That statement is absurd.  The Standard Library is traditionally implemented in C++ itself.
6. Removed the explanation that the Standard Library consists of "generic functions and classes"; that statement is bland and says nothing.  A description of what the Standard Library /actually/ contains, in detail, would be good.
7. Expanded on how non-Standard libraries can be used with C++.
----
===C++ Examples Changes===
Reworded Example 1 slightly.  It previously said "this shows the core of the program".  That was incorrect: it was a complete strictly conforming C++ program.
FIXME: A definition of strictly conforming would be nice.
"main() function" used to be in scare quotes. Unnecessary.
"main() is the highest-level function of a C++ program." is wrong, as C++ does not have nested functions. Saying that main is the "highest-level" is confusing.  It is better to use the Standard phrase for it.
The comment "// return terminates functions" was eliminated in favor of a more extended discussion on main's return type and related heresies.  If necessary, I would not be opposed to the reintroduction of that comment.
Example 2 is new and shows how return 0; can be elided from main() in C++.  Many people are unaware that this is good style in C++.
Example 3 has been corrected to use std::endl instead of a newline character.  The original manages to do the exact same thing, but only because output streams are guaranteed to be flushed during a successful termination.  Using std::endl is better style and clearer to read.
: STL 22:54, 2 Dec 2003 (UTC)
replies: text: STL 23:11, 2 Dec 2003 (UTC)

text: STL 23:23, 2 Dec 2003 (UTC)

text: STL 17:46, 4 Dec 2003 (UTC)
thread_title: Massive Edits Forthcoming

message: Reworded Example 1 slightly.  It previously said "this shows the core of the program".  That was incorrect: it was a complete strictly conforming C++ program.
FIXME: A definition of strictly conforming would be nice.
"main() function" used to be in scare quotes. Unnecessary.
"main() is the highest-level function of a C++ program." is wrong, as C++ does not have nested functions. Saying that main is the "highest-level" is confusing.  It is better to use the Standard phrase for it.
The comment "// return terminates functions" was eliminated in favor of a more extended discussion on main's return type and related heresies.  If necessary, I would not be opposed to the reintroduction of that comment.
Example 2 is new and shows how return 0; can be elided from main() in C++.  Many people are unaware that this is good style in C++.
Example 3 has been corrected to use std::endl instead of a newline character.  The original manages to do the exact same thing, but only because output streams are guaranteed to be flushed during a successful termination.  Using std::endl is better style and clearer to read.
: STL 22:54, 2 Dec 2003 (UTC)
thread_title: C++ Examples Changes

message: I didn't invent that phrase, and I don't think it consists of a "point of view".  In any case, leaving in the factual statements about the return type of main() is fine, I guess.
In _C Unleashed_, chapter 2, page 54, Richard Heathfield devotes 3 pages to "The void main Heresy".
Since the Standard flat-out declares that int is required, it's not really a point of view to say that void main is heresy.... but whatever.
: STL 23:11, 2 Dec 2003 (UTC)
replies: text: STL 23:23, 2 Dec 2003 (UTC)

text: STL 17:46, 4 Dec 2003 (UTC)
thread_title: The void main() heresy

message: Removed from article
At least, that was the case for most of the history of C++. SCO has claimed that it owns C++ via its purchase of UNIX interest from Novell, and it also claims that customers frequently comes to it to license C++.  However, SCO has not billed or sued anyone over C++, and according to Bjarne Stroustrup,
it is ISO who owns the standard upon which all C++ compilers are based.
This comes from an external link I just removed from the article. The link contained an interview with the CEO of a software company. The CEO was extremely slopping in his language and made a gaffe... saying that his company owned C++ (presumably he meant "pieces of C++ code")... but hardly something to be given much attention in this article. Pete/Pcb21 (talk) 18:32, 4 Dec 2003 (UTC)
thread_title: SCO

message: Seems to me to introduce too many concepts at once. This is only intellible to people who already know about the STL.
:Seems to me it's a sample, not a tutorial. Samples should reflect real use, and since the 'stl' is a real part of C++, samples should reflect it. None of the examples are particularily intelligible to someone who doesn't know any C++ at all -- how exactly could they be? Iamo 23:30, 28 Dec 2004 (UTC)
replies: text: Never mind, looked again and it is pretty complicated. I don't think it needs much simplifying, but it could use a little. Iamo 23:34, 28 Dec 2004 (UTC)
thread_title:  Example 4 

message: In the "Technical overview" section, there is the following text (originally from 82.69.39.138, 2005 Feb 3):
:It is important to realize that there is no longer a language called C++; the term C++ denotes a family of related languages, each usually a slightly incompatible superset of a previously defined one. Early members of this family used to be identified by version number, later members are distinguished by the year in which that specific language has been standardized.
What are these version numbers - can someone give examples? (Editions of Stroustrup's book?) Similarly, what are the years - revisions of ISO 14882? Are there serious incompatibilities between different ISO-standardised versions of C++ (e.g., the article mentioned 1998 and 2003), and do people often refer to variants of C++ like this in practice? -- JTN 21:47, 2005 Mar 4 (UTC)
: Informal names: like C++98 means latest standard. New version is (few small changes aside) compatible superset of previous one. People don't use version numbers; most often C++ mean the C++98 variant: older compilers are not used much and old code base is mostly thrown out (or kept w/o active maintenance). Pavel Vozenilek 23:00, 26 Mar 2005 (UTC)
replies: text: I agree. It should be removed. Pavel Vozenilek 23:00, 26 Mar 2005 (UTC)
thread_title:  "no longer a language called C++" 

message: Shouldn't the "See Also" links that lead to an article that does not exist, be removed?
:Not necessarily; they might be relevant subjects we're just waiting for someone to write about. Graue 22:58, 22 May 2005 (UTC)
thread_title:  See Also Links 

message: I didn't think the "Obtaining a Compiler" section was appropriate; it would make sense in a guide, but not an encyclopedia article. So I was bold in editing pages and moved those links down to a subcategory in the "External links" section, and I removed Dev-C++ since it's not a compiler, but an IDE based around a compiler already in the list. If anyone feels like making and linking to a "List of C++ compilers," that might be a better solution. Graue 22:56, 22 May 2005 (UTC)
thread_title:  Links to free compilers 

message: Anyone care to add some notes on this? descender 01:50, 24 Jun 2005 (UTC)
thread_title:  Static polymorphism with C++ templates 

message: Full text of ISO/IEC 14882 wanted, where can find it? I found no such entries in external links in the article. -- Yaohua2000 18:45, 16 July 2005 (UTC)
replies: text: That's because the standard is not free to obtain. There is old draft copy of the internet you can legally get though. Committee Draft #2 (CD2) of the 1998 C++ standard List of corridenda (corrections/updates/clarifications) voted into the 2003 standard -- KTC 10:21, 8 September 2005 (UTC)
thread_title:  Full text of ISO/IEC 14882 

message: With the most recent upgrade, could this article be moved to C++? john k 07:35, 28 July 2005 (UTC)
replies: text: Unfortunately woudn't work, HTML escaping applies. Pavel Vozenilek 17:51, 28 July 2005 (UTC)
replies: text: Now fixed as you can see  —Phil | Talk 11:06, 5 January 2006 (UTC)
thread_title:  Technical limitations? 

message: An anonymous user replaced the "C++ is not a superset of C" section with a personal rant against C++. While the addition is a blatant NPOV violation and not encyclopedic, I thought it was worth preserving on the talk page as criticism of C++. — JIP | Talk 06:44, 30 August 2005 (UTC)
replies: text: C++ is ideally suited for computer graphics, since it involves a lot of linear algebra and object oriented modelling, where operator overloading and polymorphic methods are indeed very convenient. The language also yields roughly as fast binaries as C, something which is also very importaint in realtime applications. --Fredrik Orderud 13:55, 8 September 2005 (UTC)
thread_title:  Moved from the article 

message: C was originally written as a language that was as powerful as assembly but is also portable to other platforms.  There is a common realm of thought that if the PDP-11 had supported "XCHG" instructions, we'd see them as operators in C.
C++ actually evolved from C so those who say "it's another language entirely" are not correct in my opinion.  Original C++ compilers actually generated C code.  Infact, C++ grew from the field as people used C++ in absurd and obscure ways those obscurities actually made it into the language as standards!  No matter how bad the programming methodology was!
This is C++'s fatal flaw, being backwards compatible with C.  The flexiblity of C, essentially a "macro assembler" which "high level constructs".  This doesn't make for good voodoo!  As a high level language it provides a more rigid interface and hard to expand model.  The implicit operations of C++ also make it harder to read, harder to maintain and harder to figure out exactly wtf the scope of something is.
They state that C++ is "OO" however, C can be written as OO as well.  OO is not langauge syntax but rather how the design is constructed.  Just because you use "class" doesn't automatically make your code, "OO" which is another common mistake.  Actually, if you can't understand how to do "OO" in C, you actually shouldn't be writing it in C++ because you definately don't understand "OO"!!!!!
C++ has lots of bad things such as pass by reference, operator overloading, multiple inheritence and copy constructors.  One of the main goals of an "abstraction" is just that.  The user doesn't need to know the details of how it was implemented to use it.  Unfortunately, this is not the case with C++.  You NEED to know how it was implemented in order to use it.  For example, is that implicit copy constructor a shallow or deep copy?  I better know before I pass anything by value!  What the hell does the "+" do?  By the function name, I really have no idea.  Will "-" work on the same data?  I'd rather see a function descriptive NAME rather than a + or - if it's not a real mathematical operation.
Functions and variables are hard to scope.  If you see them in a class you have no idea where they came from.  Are they global? Are they in some nth inherited class?  How about classes that reuse function names of real functions?  Hard to track down what one is being used and you could make mistakes!
What about ease of implementation?  Arrays can be dangerous with polymorphism!  Typecasting back to a base class and indexing will cause corruption of data!!! AND THIS COMPILES FINE!  Now to write a simple array you have to write hundreds of lines of code to do something so simple.  So there's trade offs, to do something simple you need to write tons of code!
C is easier to read and understand.  There are less keywords to make it simpler to optimize and figure out what's going on.  If you consider that people can write bad C code and C++ includes C and more, then obviously C++ is a disaster waiting to happen because you have all the bad habits that can occur in C (from a few simple keywords) to everything new that you can do (a ton of complex, hard to read and understand functionalities and implicit operations).
All in all, if you want high level constructs, use a high level language like Java or C#.  If you want lower level constructs, use C or assembly if need be.  However, never use C++!!!!!!!!!
: C++ is ideally suited for computer graphics, since it involves a lot of linear algebra and object oriented modelling, where operator overloading and polymorphic methods are indeed very convenient. The language also yields roughly as fast binaries as C, something which is also very importaint in realtime applications. --Fredrik Orderud 13:55, 8 September 2005 (UTC)
thread_title:  C++ is not as good as C 

message: Perhaps someone should try to get this article featured. Java already is :( :) --MarSch 15:30, 27 October 2005 (UTC)
replies: text: This article needs a LOT of work before it can get there.  It is very messy/disorganized and could do with a lot more information added.  Nathan J. Yoder 17:33, 27 October 2005 (UTC)
replies: text: How do you think it should be organized and what info needs to be added? --MarSch 13:16, 28 October 2005 (UTC)
thread_title:  peer review or FAC? 

message: I've added syntax highlighting to the code snippets.  They highlighting style is à la "Visual C++", whereby keywords and preprocessor directives are blue (I used "mediumblue" for less visual intrusion) and comments are green. --K3rb 03:56, 25 November 2005 (UTC)
replies: text: Well, after some contemplation, I've removed all the syntax highlighting. Reasoning: highlighting is useful for experienced programmers, but it may confuse readers unfamiliar with programming into thinking that the color is neccessary element of the code examples. See the C programming language talk page for their motivation to not highlight the C code samples. --K3rb 05:17, 27 November 2005 (UTC)
thread_title:  Syntax highlighting 

message: What would yall think of a criticism section for this article?
Justforasecond 05:45, 17 January 2006 (UTC)
replies: text: There are so many criticisms of C++ from so many different points of view, many of them conflicting.  If you want to do this I would suggest you consider close to all of them and keep in mind it is a contentious topic and someone will probably disagree with what you write.  – Andyluciano 16:51, 17 January 2006 (UTC)
thread_title:  criticism section? 

message: Wouldn't be more accurate to describe C++ as multiparadigm language instead of 'OO' to help distinguish it from languages like java etc. FlyHigh 19:50, 17 January 2006 (UTC)
replies: text: I agree.  For one, the programming paradigm article specifically cites C++ as an example.  Edited.  – Andyluciano 05:20, 20 January 2006 (UTC)
thread_title:  Paradigm 

message: It seems there's a new C++ struct article, which explains member functions, constructors/destructors and operator overloading, with structs rather than classes. Of course, it's more usual to explain classes first, with the note that C++'s structs are the same as classes except that members are 'public' by default. Can somebody set them straight, please? I never seem to get anywhere with such disputes. StuartBrady 17:38, 28 January 2006 (UTC)
thread_title:  C++ struct article