Talk:C++/Archive 12
![]() | This is an archive of past discussions about C++. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 5 | ← | Archive 10 | Archive 11 | Archive 12 |
paragraph regarding C++ Exception Handling was removed
After 16 years of the availability of C++ Exception Handling this page did not mention anything about it. I added a paragraph. My edit certainly reflected that this is still today a hotly contested & emotional subject for a majority of C++ programmers outside of boost or the C++ standard library. My edit was removed. I hope that somebody else will undo the removal or write some paragraph by himself about the same subject. This should certainly contain some mentioning about the phobia which still exists regarding this subject in the majority of people which make their money with C++. ExcessPhase (talk) 19:14, 7 November 2012 (UTC)
- That's great. Show your sources. And I continue to strongly recommend abandoning the hyperbolic term "phobia". Nobody on this planet has a clinically diagnosable phobia of exception handling. —chaos5023 (talk) 21:02, 7 November 2012 (UTC)
Talks which exhibit such a phobia usually don't make it into the public, because these people are rightly ashamed of themselfs -- if not now, than in a couple of years. And that somebody questions my authority regarding this subject pisses me off. Gehabt Euch wohl!
http://stackoverflow.com/questions/5426708/why-are-exceptions-so-rarely-used-in-c http://stackoverflow.com/questions/3490106/we-do-not-use-c-exceptions-whats-the-alternative-let-it-crash http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Exceptions — Preceding unsigned comment added by 192.73.228.23 (talk) 21:43, 7 November 2012 (UTC)
- It's possible that "phobia" has a more restricted meaning in English than "phobie" has in German. You may wish to review the article Phobia.
- As to questioning your authority, yes, that's a problem subject matter experts routinely have with Wikipedia that makes them unhappy engaging with it. The painful truth of the matter is, though, that Wikipedia's policy on verifiability means that your personal knowledge counts for nothing in and of itself; what matters is what you can source (though of course your personal knowledge helps you figure out what you can say that's verifiable). If you aren't willing to go to the effort of working from verifiable, reliable sources, though, I'm very much afraid you're likely to find your contributions continuing to be unwelcome.
- The StackOverflow posts you link to are textbook examples of things that are not reliable sources and so not useful for verifiability purposes. The only way the Google Code policy document would demonstrate anything relevant is if you concluded by WP:SYNTHESIS that Google suffers from a phobia of exceptions, since all it says is that they don't use them. —chaos5023 (talk) 21:49, 7 November 2012 (UTC)
Request for comments: Establish standards for version history tables in software articles
I'd like to introduce the Template:Version template to Wikipedia with the goal to establish one standard for version history tables (or lists). It simplifies creation of release histories, standardizes release stages and makes the content more accessible. Please comment on the template talk page (there already is some discussion). Thanks for your contribution. Jesus Presley (talk) 07:09, 28 November 2012 (UTC)
Critique by Matt Weisfeld
How is that even critique? Unless object orientedness is some ultimate holy grail, theres nothing wrong with being _not_ object oriented. This should probably be moved elswhere in the article, any thoughts where? Kyle2^32-1 (talk) 20:19, 26 August 2012 (UTC)
- C++ contains all necessary OO features, but isn't 'pure OO', which is what the quotes were talking about of C++, no, there is no benefit to being purely OO, being multi paradigm is beneficial as it allows programmers to express ideas in the way of their preference, for some that is OO, and in ways impossible in 'pure OO', which can be, and are often are, more efficient and readable than what can be expressed in 'pure OO'. MThinkCpp (talk) 17:54, 29 May 2013 (UTC)
- Nearly all modern programming languages enforce some paradigms. (Python enforces indentation Java explicit casting...) This increases readability because you don't have think on every code you read in a other way, since every person has other preferences. A other aspect is that many people (the majority) think that a good programming language has to protect the programmer from making big mistakes (google for "do programmers need seat belts") You will find many people who think different but you can't say all these famous computer scientist telling only bullshit. --Fabiwanne (talk) 21:47, 7 July 2013 (UTC)
- You appear to be confusing "computer scientist" and "famous programmer". They're not the same. Matt Weisfeld, by the way, appears to be neither. TEDickey (talk) 21:53, 7 July 2013 (UTC)
Ken Thompson quote in Criticism
This recent edit was just reverted out of the Criticism section as "WP:Soapbox comments". It looks legitimate to me, and a better inclusion than either Weisfeld's and Kay's quotes, which are both redundant to the second paragraph in the section and would be better placed as refs to it instead of being quoted in full. (Not to mention the Torvalds comment, which isn't criticism at all, but merely an opinion that it's "horrible". It's like having a cricitism section in Broccoli with George Bush's quote about not having to eat it anymore since he became president.) 74.74.150.139 (talk) 22:56, 7 January 2013 (UTC)
- The quote was more along the lines of criticism of Stroustrup than relating to the language design itself. Keep in mind that this is a topic about the language TEDickey (talk) 23:13, 7 January 2013 (UTC)
Renaming "Etymology" section to "Derivation of the name C++"
Though etymology is a perfect heading, it may be quite difficult for some people to understand. Changing it to a suitable easily understandable heading is suggested. SmackoVector (talk) 11:08, 18 August 2013 (UTC)
Implementation language???
Seriously, do u guys think that C++ is implemented in C? :| (same thing about java even if that's not the right place to talk about that...) — Preceding unsigned comment added by 93.48.134.18 (talk) 20:56, 13 December 2012 (UTC)
- Wrong place for this question, C++ implementation language is implementation defined (i.e. could be C or C++, etc.)MThinkCpp (talk) 17:49, 29 May 2013 (UTC)
C was used to make the first compiler for C++ then was used to develop itself. Titamation (talk) 21:34, 13 August 2013 (UTC)
- A reliable source is still lacking TEDickey (talk) 09:19, 14 August 2013 (UTC)
- How about http://www.stroustrup.com/hopl2.pdf, page 19, line 12 'so that the very first working C++ compiler was done in C++'. MThinkCpp (talk) 09:42, 15 August 2013 (UTC)
Bjarne talks about the creation of c++ here Titamation (talk) 22:38, 14 August 2013 (UTC)
- That doesn't match your statement above (Bjarne states that he wrote an intermediate stage which was not exactly C or C++) TEDickey (talk) 23:01, 14 August 2013 (UTC)
C++ was originally implemented using Cfront to create C-code. See http://en.wikipedia.org/wiki/Cfront — Preceding unsigned comment added by 81.170.169.35 (talk) 23:58, 19 October 2013 (UTC)
Exception Handling
I see that there is still no paragraph regarding exception handling. Embarrassing. See the paragraph I wrote some time ago: http://en.wikipedia.org/w/index.php?title=C%2B%2B&oldid=530499768 — Preceding unsigned comment added by 192.73.228.23 (talk) 21:35, 22 October 2013 (UTC)
Implementation language???
Seriously, do u guys think that C++ is implemented in C? :| (same thing about java even if that's not the right place to talk about that...) — Preceding unsigned comment added by 93.48.134.18 (talk) 20:56, 13 December 2012 (UTC)
- Wrong place for this question, C++ implementation language is implementation defined (i.e. could be C or C++, etc.)MThinkCpp (talk) 17:49, 29 May 2013 (UTC)
C was used to make the first compiler for C++ then was used to develop itself. Titamation (talk) 21:34, 13 August 2013 (UTC)
- A reliable source is still lacking TEDickey (talk) 09:19, 14 August 2013 (UTC)
- How about http://www.stroustrup.com/hopl2.pdf, page 19, line 12 'so that the very first working C++ compiler was done in C++'. MThinkCpp (talk) 09:42, 15 August 2013 (UTC)
Bjarne talks about the creation of c++ here Titamation (talk) 22:38, 14 August 2013 (UTC)
- That doesn't match your statement above (Bjarne states that he wrote an intermediate stage which was not exactly C or C++) TEDickey (talk) 23:01, 14 August 2013 (UTC)
C++ was originally implemented using Cfront to create C-code. See http://en.wikipedia.org/wiki/Cfront — Preceding unsigned comment added by 81.170.169.35 (talk) 23:58, 19 October 2013 (UTC)
Exception Handling
I see that there is still no paragraph regarding exception handling. Embarrassing. See the paragraph I wrote some time ago: http://en.wikipedia.org/w/index.php?title=C%2B%2B&oldid=530499768 — Preceding unsigned comment added by 192.73.228.23 (talk) 21:35, 22 October 2013 (UTC)
Remove dialects in infobox?
Are there any objections to the dialects being removed from the infobox. The primary motivation to remove them is that the C++ ISO committe discourages them, as does the creator of C++ see [1] page 30, paragraph 2 (ignoring the end of a paragraph at the top of the page) mthinkcpp (talk) 17:10, 26 October 2013 (UTC)
- Removed. mthinkcpp (talk) 12:15, 27 October 2013 (UTC)
"Influenced by" section
Many other pages about programming languages have an "Influenced by" section in that box on the right. C++ could have that too, containing at least C and Simula. Unfortunately the article is locked so I cannot add it. — Preceding unsigned comment added by 46.249.133.113 (talk) 10:46, 1 October 2013 (UTC)
- There isn't enough content to create a section (other than a list of a couple of languages) for it (though if you do have the content, post it here for approval) - the necessary details of C++'s ancestors are covered in the C++#History. The article is locked because of vandalism, to (indirectly) edit a locked page, see Wikipedia:PROTECT#Semi-protection. MThinkCpp (talk) 16:12, 1 October 2013 (UTC)
- I don't know why the information box doesn't have this information, though. I added it based on information from the History section:
- "Besides C and Simula, some other languages that inspired him were ALGOL 68, Ada, CLU and ML." Abstractematics (talk) 19:46, 1 November 2013 (UTC)
garbage collection in C++?????
Garbage collection is not necessary in C++ as there is RAII. Quite ridiculous!!! — Preceding unsigned comment added by 166.137.191.32 (talk) 02:39, 22 November 2013 (UTC)
- Not necessarily. Consider cyclic references, for instance. Much easier to deal with on a GC rather than smart-pointer level... -Sebastian Garth (talk) 07:19, 22 November 2013 (UTC)
parser section is really not necessary here
most people want to use C++ not rewrite it... — Preceding unsigned comment added by ExcessPhase (talk • contribs) 02:39, 10 February 2014 (UTC)
Semi-protected edit request on 26 February 2014
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
In section 2.6-Exception handling, the first sentence is missing an 'a'. It should be "Exception handling is a mechanism..." and not "Exception handling is mechanism..." Staroobula (talk) 01:13, 26 February 2014 (UTC)
Done — {{U|Technical 13}} (t • e • c) 01:18, 26 February 2014 (UTC)
Removed Criticism
Mthinkcpp has removed almost all criticism. Since he has contributed much good things I don't think he made this in bad faith. But also C++ seems for HIM to be the best programming language as it is. There can be valid criticism. So I would like to redo his changes. --Fabiwanne (talk)
- The lack of a proper criticism section and the general fanboyism of this article is extremely unfortunate. The reader is left with the impression that C++ can't "take the heat". It'd be much better to list the problems of C++ and let the readers decide. Mkcmkc (talk) 00:35, 10 August 2013 (UTC)
- The criticism section in any article and specially in this one is indispensable. All programming languages are subject to criticism in real life. I think the reader at least should know that there are many things/facts such as the list mentioned here: http://yosefk.com/c++fqa/defective.html in which C++ has been challenged/criticised. And those are some of the reasons why there are a plethora of other languages out there (Java, C#, D, Go, etc) which were born trying to address some/all of that concerns, and the reason why the C++ standard is still evolving. Alcides fp (talk) 02:44, 16 September 2013 (UTC)
- Criticism sections are not indispensable, it's actually quite the opposite and discouraged by WP policy. WP:CSECTION. Also that link (yosefk) is opinions an original research and has no place here. Criticism should be used throughout or not at all. Splitting the point of view into a section is generally a bad idea. Beakermeep (talk) —Preceding undated comment added 02:14, 20 October 2013 (UTC)
- I never said the list here was authoritative I only mentioned it as an example of some topics that could/should be included in a serious Criticism section in *this* article. By the way, articles on languages such as Pascal, Java and even Haskell all of them have a Criticism section, in fact Java has a whole article on it. So I can't see the reason why this article shouldn't have one.AlcidesFP (talk) 19:11, 1 April 2014 (UTC)
- While a criticism of C++ has been re-added, it really seems self-serving. Flexibility in mixing paradigms is NOT why C++ is generally criticized (other languages which do so, such as Python, are celebrated for it). Inconsistency (i.e. the static keyword) due to organic growth from C, difficulty in parsing the grammar (and therefore creating compilers/tools), flaws in the standard library (i.e. std::string intended but not suitable for COW), verbosity of high-level patterns (implementing an container can be quite a feat), are all examples of legitimate criticisms. I'd think the section should be made more robust or removed - right now it's a mockery of the word "criticism." — Preceding unsigned comment added by 68.33.220.238 (talk) 14:09, 20 October 2013 (UTC)
- Mixing paradigms was an attribute in C++ which was explicitly chosen. So many people love it for that. But this has bad sides too. In fact it's one of the things that you recognize at first when you learn C++. Since there are many paradigms you have to learn all and find out the right ones if you want to understand C++-Code. So there are other languages (like Java) which explicitly prevent you from using "the wrong" paradigms. In fact the most programming languages do this. Other languages which explicitly allow many paradigms are criticized for this too. (See perl.) --Fabiwanne (talk) 11:23, 18 January 2014 (UTC)
- There are a lot of criticisms you can make about C++, and a lot you can make about any language. If you're going to make a list of criticisms about C++, then you should about every programming language; and while maybe feasible, would not be useful if only because a normal reader of wikipedia article could not be expected to judge the relevance of the criticisms. For example, I'm a C++ programmer and the "std::string intended but not suitable for COW" criticism is perhaps true, but doesn't affect the software I write in any meaningful way. Furthermore, the article as it was said that C++ was "compared unfavorably" for reasons that I would consider one of C++'s best qualities njaard (talk) 18:05, 22 October 2013 (UTC)
- Side note: the link has appeared before in a previous criticisms discussion Talk:C++/Archive_10#Criticism - and been marked as no use/biased/inaccurate Talk:C++/Archive_10#Do_we_need_this_retarded_criticism_page.3F, several times. mthinkcpp (talk) 13:13, 2 November 2013 (UTC)
Still no mentioning of C++ Exception Handling -- embarrassing
After nearly 20 years (18 to be correct) of working implementations of C++ Exception Handling this "encyclopedia" does not mention anything regarding it. Embarrassing. If you look in the history of the page, you'll find the paragraph I added some time ago (http://en.wikipedia.org/w/index.php?title=C%2B%2B&oldid=521857592), which was removed, as I did not provide any references (I'm not aware of any). — Preceding unsigned comment added by 192.73.228.23 (talk) 18:50, 5 February 2014 (UTC)
- Exception handling is a feature present in many languages at this point. With that in mind, is there any particular reason why the page on C++ needs a section about it? Novusuna talk 19:27, 5 February 2014 (UTC)
- The same reason why other major features of C++ are being mentioned in this article. — Preceding unsigned comment added by 192.73.228.23 (talk) 20:30, 5 February 2014 (UTC)
- I agree with 192.xxx. C++ exceptions are significant enough to warrant a section under "Language", if not an article on its own.
decltype
(talk) 09:40, 7 February 2014 (UTC)- Finally somebody started. And maybe it does not get deleted by some exception phobic person. I added a one clarification (regarding handler -- which many people (including me) confuse with something being called from the place of error (like signal handler) -- but exception handling is about stack/scope unrolling). Feel free to change this to express it better. I think what also needs to be here:
- only using C++ Exception Handling one can abort a constructor. Thus fallible resource allocations can now be put into a constructor AND any following code (another constructor) can rely on that the previous one was successful. Potentially compare to two-step-construction which was used before C++ Exception Handling.
- if-less programming -- code is written for the everything-until-now-worked case
- real word scenarios -- don't deal with programming mistakes like range overflow but system errors returned by system calls
- example scenario of an object, which needs 10 different types of resources to be allocated in the constructor(s). Reporting any failed allocation to the caller. Deallocation in the constructors. With and without C++ Exception Handling.
- compare to eating up/ignoring error codes. Example could be some C code using printf() and not reporting the error from printf() to the caller of the code resulting in developers having to use a debugger to find out what is failing and where. — Preceding unsigned comment added by ExcessPhase (talk • contribs) 02:37, 10 February 2014 (UTC)
- Finally somebody started. And maybe it does not get deleted by some exception phobic person. I added a one clarification (regarding handler -- which many people (including me) confuse with something being called from the place of error (like signal handler) -- but exception handling is about stack/scope unrolling). Feel free to change this to express it better. I think what also needs to be here:
- I agree with 192.xxx. C++ exceptions are significant enough to warrant a section under "Language", if not an article on its own.
- The same reason why other major features of C++ are being mentioned in this article. — Preceding unsigned comment added by 192.73.228.23 (talk) 20:30, 5 February 2014 (UTC)
The demonstration of exception handling to catch programming bugs like index-out-of-bounds error, is not helping people to appreciate exception handling. At least one could mention, that the constructor of the vector could also throw AND that the code after the constructor will only be executed, if the constructor was successful. The if-less programming style enabled by exception handling needs to be demonstrated. Better would be to show a series of system calls, which depend on each other, with every one potentially failing. Including RAII:
- open file
- mmap (only done if preceding open was successful)
- close file (only done if preceding open was successful)
- count number of newlines (only done if preceding mmap was successful)
- munmap (only done if preceding mmap was successful)
(lifetime of open-close object shortened by using an boost::optional) — Preceding unsigned comment added by 192.73.228.23 (talk) 23:21, 9 May 2014 (UTC)
"Unknown errors can be caught"...
Wrong. Errors cannot be caught. Unknown types of exceptions can be caught... — Preceding unsigned comment added by ExcessPhase (talk • contribs) 22:15, 25 May 2014 (UTC)
- Fixed. mthinkcpp (talk) 13:22, 26 May 2014 (UTC)
compatibility to C
There is no need to have a paragraph regarding compatibility with other languages (including C) here. C++ is meanwhile a separate language. That it once was a superset of the then existing C is only of historical importance.ExcessPhase (talk) 22:07, 25 May 2014 (UTC)
- Bjarne Stroustrup considers it worth mentioning, he devotes a chapter to it in The C++ Programming Language (advanced) and Programming Principles and Practice (Beginners). I have removed the C++11 list though, and transferred it to the C++11 page (as it is better suited there). mthinkcpp (talk) 13:34, 26 May 2014 (UTC)