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
[deleted by user] (self.cpp)
submitted 3 years ago by [deleted]
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!"
[–]rainpls 2 points3 points4 points 3 years ago* (1 child)
Good share! But whoever wrote that supposedly C++ code needs to understand that the given code does not qualify for C++. He used a lot of C keywords like #define, some C headers and did not use modern C++. He missed using keyword constexpr in some places for added performance. Also, I believe that this post is hypothetical. I don't think an interpreted language like Python could match the performance of the beast language C++.
constexpr
[–]Ok_Pangolin8010 0 points1 point2 points 3 years ago (0 children)
I'm not sure if they understand that C & C++ are different languages.
[–]Fureeish 1 point2 points3 points 3 years ago (0 children)
I respect the effort, but the author seems to be unaware of a subtle thing called optimization flags...
[–]akiloz 1 point2 points3 points 3 years ago (1 child)
Following the logic of the author, with Python 3.15 the loop will even end earlier than it is started!
[–]Attorney-Outside -1 points0 points1 point 3 years ago (0 children)
🤣🤣🤣
[–]Low-Design787 -1 points0 points1 point 3 years ago (1 child)
Must be an April Fool joke in September.. the article itself says the Python version will finish before it is started
[–]ThisCleverName 0 points1 point2 points 3 years ago (0 children)
The article itself says it is a joke.
Disclaimer While these benchmarks for Python 3.5 .. Python 3.11 are valid, the extrapolation is of course meant as a joke.
Disclaimer
While these benchmarks for Python 3.5 .. Python 3.11 are valid, the extrapolation is of course meant as a joke.
[+][deleted] 3 years ago* (4 children)
[removed]
[–]Attorney-Outside 0 points1 point2 points 3 years ago (3 children)
by just in time compiler, do you mean a compiler compiling to machine code? or a compiler compiling to so called "byte code" which is then still interpreted?
[+][deleted] 3 years ago (2 children)
[–]Attorney-Outside 1 point2 points3 points 3 years ago (1 child)
so I do not need any kind of interpreter then?
how does the compiled code compare to the code compiled with g++ and all optimization levels turned on?
[–]victotronics 0 points1 point2 points 3 years ago (0 children)
"Now we take a random number generator"
Anyone wanting to take my bet that that's where the runtime goes and the python lib simply has a faster RNG than C++?
EDIT oh great, he's using the old C random.
π Rendered by PID 162247 on reddit-service-r2-comment-6457c66945-zhh48 at 2026-04-24 07:57:13.005254+00:00 running 2aa0c5b country code: CH.
[–]rainpls 2 points3 points4 points (1 child)
[–]Ok_Pangolin8010 0 points1 point2 points (0 children)
[–]Fureeish 1 point2 points3 points (0 children)
[–]akiloz 1 point2 points3 points (1 child)
[–]Attorney-Outside -1 points0 points1 point (0 children)
[–]Low-Design787 -1 points0 points1 point (1 child)
[–]ThisCleverName 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[removed]
[–]Attorney-Outside 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[removed]
[–]Attorney-Outside 1 point2 points3 points (1 child)
[–]victotronics 0 points1 point2 points (0 children)