Top Qs
Timeline
Chat
Perspective

Talk:C++

From Wikipedia, the free encyclopedia

Remove ads
More information Article milestones, Date ...
More information Things you can help WikiProject Computer science with: ...

Remove ads

Move Language section to C++ syntax

Summarize
Perspective

The Language section is excessively long and provides copious amounts of technical information that isn’t appropriate when pages like C++ syntax exists (it was previously a redirect page to this section, but there is no reason to leave it as a redirect when such a page could be expanded to contain the technical information). Pages such as Java (programming language) are much more concise and leave the intricacies of syntax to its own page, Java syntax. Therefore I propose that the section should be cleared or at least simplified enough to shorten and keep the technical details to the dedicated page. 72.136.107.164 (talk) 20:53, 27 February 2025 (UTC)

This is not an RfC matter. Discuss in the normal way please. If it is felt that broader input is needed, the procedure described at WP:SPLIT should be followed. --Redrose64 🌹 (talk) 19:40, 3 March 2025 (UTC)
I do think that Language should be moved to a different article, as it is quite long. It would also be good to split it for people who want to learn the language and for people who just want to learn the history of the language as they may get confused. Vivaidris (talk) 19:46, 10 March 2025 (UTC)
I think it would be ideal if the Language section were not deleted entirely, but trimmed or otherwise rewritten only to contain rudimentary knowledge/information on the language, while detailed information about the language and its syntax were moved to the C++ syntax page. 129.97.124.47 (talk) 22:37, 10 March 2025 (UTC)
It's been a month since this discussion began and there hasn't been much disagreement (though admittedly not much engagement at all), is it okay to just make the requested changes? 129.97.124.74 (talk) 11:06, 28 March 2025 (UTC)
Well, have you left notes at interested Wikiprojects, like Wikipedia talk:WikiProject C/C++ or Wikipedia talk:WikiProject Computer science? Templates such as {{fyi}} and {{subst:please see}} are available for this. --Redrose64 🌹 (talk) 15:17, 29 March 2025 (UTC)
I have done this now. I will await some responses and if nothing is said I will just proceed with making the changes. 129.97.124.119 (talk) 20:14, 2 April 2025 (UTC)
I think enough time has passed. I am going to make the changes now. 129.97.124.133 (talk) 10:57, 8 April 2025 (UTC)
Remove ads

Proposed Edits to C++ Compatibility Section: C++ and Assembly

I would like to update the compatibility section of the C++ article to include a brief mention of the relationship between C++ and Assembly language. The goal is to highlight how C++ can interface with Assembly, particularly in contexts where low-level programming or performance optimizations are required, looking for any feedback or advice before I begin editing.

Key Points to be Added:

  • Interfacing with Assembly: C++ allows for the inclusion of inline assembly, enabling programmers to write assembly code within C++ programs for tasks that require direct hardware manipulation or highly optimized routines.
  • Assembly Language Integration: Many C++ compilers, like GCC and MSVC, support integrating assembly code into C++ programs, offering fine-grained control over system resources.
  • Performance Considerations: C++’s low-level access and ability to combine with assembly language can be crucial for performance-critical applications, particularly in embedded systems or system programming.

References

  • asm declaration
  • Interfacing C and C++ With Assembly Language

Vasisht25 (talk) 16:08, 30 March 2025 (UTC)

Remove ads

Update to Standardization Section

I'm looking to append to the bullet points in this section with two recently published technical reports and documents from the C++ International Organization for Standardization. ISO/IEC TS 9922:2024 offers specifications for C++ extensions for concurrency 2, and ISO/IEC TS 19568:2024 covers C++ extensions for library fundamentals. I believe these additions will keep the article page more up to date with the committee. TheGreatMuffinMan125 (talk) 04:35, 31 March 2025 (UTC)

Request for comments regarding C++ "Hello, world" program

Summarize
Perspective

C++23 introduces a new "Hello, world" program:

import std;

int main() {
    std::println("Hello, world!");
}

contrasting the traditional, more verbose version:

#include <iostream>

int main() {
    std::cout << "Hello, world!" << std::endl;
}

While I personally prefer to present modern examples of code as much as possible, it is still undeniable that the second (older) example is essentially ubiquitous in both the literature and any tutorials on the language. Indeed the first is perhaps far more beginner-friendly (avoids explaining the operator<<, I/O streams, etc.), however it is still far too recent to be accepted as the C++ "Hello, world" program. (Do note that currently, the "Hello world" program has a note requesting that users first discuss changes on the talk page/get consensus before actually changing it.) I contrast this with the Java (programming language) page, where the Java 25 updated "Hello, world" program was adopted on the page, and I started a related RfC on that page. I also noticed that there was a talk about this about a year and a half ago, but I think that enough time has passed to revisit this discussion. It was mentioned that the newer version appears in Stroustrup's new books, but I haven't looked at those books. 24.50.56.74 (talk) 18:12, 7 October 2025 (UTC)

Is there a reason we can't just include both? Loki (talk) 19:44, 7 October 2025 (UTC)
I wouldn't have a problem with that, someone suggested displaying both on the Java RfC that I posted as well. 24.50.56.74 (talk) 20:13, 7 October 2025 (UTC)
Both is good, which is what Java (programming language) § Hello world does. SWinxy (talk) 02:45, 11 October 2025 (UTC)
It looks like the consensus is to just include both. Most people seem to favour either using both or just the newer one the way I see it. Should we just go ahead and make this change and end the RfC? I'll do it myself if I don't hear any objections in the next little while. 24.50.56.74 (talk) 15:54, 14 October 2025 (UTC)
(Summoned by bot) i dont think wikipedia is a technical manual so we really dont need to replicate what other technical manuals do. That being said it makes sense to display whatever is the “official” example of hello world. User:Bluethricecreamman (Talk·Contribs) 19:50, 7 October 2025 (UTC)
(Summoned by bot) Wikipedia does present technical content, some of the chemistry content gets rather complex, as well as the math articles. I recommend either both or the newer form: both to support readers through the transition period and the sheer notability of the change in syntax; the newer form as it will inevitably become the standard. With the advancement of AI into the programming field, supporting newer programmers will become less of a need. Since we're trying to document current technology, I favor the newer syntax. .digamma (talk) 21:34, 7 October 2025 (UTC)
Wikipedia also provides historical content. · · · Peter Southwood (talk): 04:42, 8 October 2025 (UTC)
In my opinion there is nothing wrong with showing both (the RfC on the Java page came to that agreement), though I personally prefer showing modern version as it is simpler and most people will just be using that moving forward. 24.50.56.74 (talk) 19:42, 10 October 2025 (UTC)
println is modern? WhatamIdoing (talk) 18:22, 12 October 2025 (UTC)
In C++, yes. Loki (talk) 20:35, 12 October 2025 (UTC)
I'm also proposing amending the traditional "Hello, world" program (by Bjarne) to move the opening bracket to the same line as the main() declaration. I don't know if this needs an RfC, and I'm reluctant to start a new one right after just closing this one. The spirit of Bjarne's "Hello, world" program is still kept the same, all we are doing is moving the opening bracket, which is how most of the functions in C++ on Wikipedia appear to be written anyway, and there isn't much of a useful reason to dedicate an entire line to an opening bracket. I'm open to hearing any thoughts. 24.50.56.74 (talk) 17:28, 14 October 2025 (UTC)
Agree with keeping both as in the current article. {{u|Gtoffoletto}}talk 18:10, 15 October 2025 (UTC)
Remove ads

Needs a revision

C++ is my programming language (99% of the time). It's a language I love to hate and hate to love. OK, that personal baggage aside, in my opinion this article is ...pretty bad. I don't dispute that it generally is accurate, but I don't think it is as useful and informative as it could and should be. Two examples, and I could point out a lot more. C++14 is mentioned as if it was a significant change but then admits it was minor. So, why mention it? You waste the readers time!! The more problematical (imho) issue is that Modern C++ is a very different language than classic C++ (say C++98). The fact that this isn't even mentioned is an enormous disservice to the reader. I probably don't need to give examples of the big differences but as a hobbyist, I've got "how to" books on my shelf (classic C++) that would be nearly useless in trying to understand the syntax of modern C++. And vice versa. Pointers, modules, loops, there's been huge changes in "best practices" since 1985. I suspect that the 98 version shares more in common with ANSI C (1989) than with C++23. Containers (for loops, etc.), generic programming, safe pointers, and on and on. To my mind the difference between C++23 (and its immediate predecessors) and C++98 03 and even 11 is like the difference between Old English and Modern American English - nearly mutually unintelligible. Another issue: TIOBE rankings. They're from 2024 and don't reflect the current rankings. Worse still there are at least two other major indices: Redmonk and IEEE which have different but equally valid ways to rank popularity. Plus (no pun intended), with vibe programming on an exponential rise, ranking what languages are being used by how many is increasingly difficult to capture/measure. Stoustrup argues that modern C++ is more type safe than ever. I disagree. With generic definitions, it is extremely difficult to know what a variable's type is (unless it's provided by the UI/compiler). Compare these lines (numbered for clarity) 10 Int X; and 20 Y = SomeReferencedVariable;. We easily see what X's type is in the former, but what is Y in the latter?? Can we write 30 X = X + Y;?? without an error? OK, I'll get off my soapbox. But seriously, while some of the above is probably too technical for WP, the dramatic changes that modern C++ contains makes the failure to mention the enormous growth in the language (remind me again about what the size of the standard library was in 1997 vs 2025?), the implementation of modules, type safety, and on and on, surely deserve more than a passing acknowledgement.~2025-39446-09 (talk) 09:53, 21 December 2025 (UTC)

Remove ads
Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads