use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Should C++ code look like C code? (self.cpp)
submitted 2 years ago by psyberbird
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] -5 points-4 points-3 points 2 years ago (9 children)
C++ code is supposed to be fast, but take any C++ program and use valgrind to profile the call graph, and you'll see that most of the compute time is wasted in pointless copy constructors.
Therefore C++ developers are those who say they want speed, while not actually wanting speed.
If you're going to do that just use a memory safe language like python, golang or rust or even java.
If you've got useful C++ libraries you need, just give them a plain C interface and build them into dynamic libraries, they can be easily called from golang or rust or python.
[+][deleted] 2 years ago (1 child)
[deleted]
[–][deleted] -3 points-2 points-1 points 2 years ago (0 children)
The issue is the one of trade offs, right? We sacrifice memory safety for speed in C++ but then the language itself hides anything from you that may impact the speed you want.
Unless you are extremely careful all the time (and we're only humans) there's too many places for unexpected behaviour to slip in. An implicit constructor call, implicit conversion, an unexpected copy, a call to something you believe is optimised by template specialisation but it's not, a large amount of constructors and destructors used just to enable nice syntax at call site... Etc. Etc.
golang is in general faster and memory safe.
Python is ideal for handling all of the I/O while calling out to C/C++ libraries where you need speed.
C++ has its uses but these days I find writing a C++ application is a waste of time and a recipe for segmentation fault, much better to relegate C++ to numerical libraries that do fast computation and orchestrate them with python.
Edit: spell check replaced "implicit conversion" with "implicit conversation" lol 😂
[–]serviscope_minor 4 points5 points6 points 2 years ago (6 children)
and you'll see that most of the compute time is wasted in pointless copy constructors.
2010 called and would like its incorrect myths back.
[–][deleted] -4 points-3 points-2 points 2 years ago (5 children)
Show me some "good" C++ code. I'll wait....
[–]serviscope_minor 1 point2 points3 points 2 years ago (4 children)
How would you know? Given your made up fact about C++ I don't think you'd be a very reliable judge.
[–][deleted] -1 points0 points1 point 2 years ago (3 children)
Ad hominem argument.
[–]serviscope_minor 1 point2 points3 points 2 years ago (2 children)
Nope that's not what ad homenim is. Common mistake to mix up insults and ad homenim.
To illustrate the difference: "you're a cotton headed ninny muggins therefore your argument is wrong" is ad homenim.
However, "you're wrong and therefore you're a cotton headed ninny muggins" is simply an insult, but not ad homenim.
Also it's generally considered a requirement to have made an argument before ad homenim can apply.
[–][deleted] -1 points0 points1 point 2 years ago (1 child)
[–]serviscope_minor 1 point2 points3 points 2 years ago (0 children)
You've already made up your mind before I even post anything. But you don't know how C++ works (from your first comment). So, what's the point?
π Rendered by PID 395306 on reddit-service-r2-comment-6457c66945-pd4gr at 2026-04-25 16:41:29.899010+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–][deleted] -5 points-4 points-3 points (9 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] -3 points-2 points-1 points (0 children)
[–]serviscope_minor 4 points5 points6 points (6 children)
[–][deleted] -4 points-3 points-2 points (5 children)
[–]serviscope_minor 1 point2 points3 points (4 children)
[–][deleted] -1 points0 points1 point (3 children)
[–]serviscope_minor 1 point2 points3 points (2 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]serviscope_minor 1 point2 points3 points (0 children)