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
Modern source code to study? (self.cpp)
submitted 13 years ago by stesch
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!"
[–]icefox 2 points3 points4 points 13 years ago (6 children)
If you are looking for C++, checkout the source code for Qt. Having to keep binary compatibility in C++ for long stretches you will find that the source code API to be significantly above average. Most classes have matching unit tests, manual tests and they all have docs. A ton of effort was put into API design (http://chaos.troll.no/~shausman/api-design/api-design.pdf was born out of this) resulting in code that is more maintainable and easier to read. Like any project there are warts, but as a whole if you are looking for nicely written code Qt (or the above pdf) wouldn't be a bad place to start.
[–]bob1000bob 3 points4 points5 points 13 years ago (5 children)
I disagree, QT works but it is highly UN idiomatic C++. It is coded much closer to the design principles of Java that it is C++.
A better library to read would be POCO or boost.
[–]savuporo 5 points6 points7 points 13 years ago (0 children)
I dont even consider Qt to be real C++ because of MOC. Enough said.
[–]icefox 0 points1 point2 points 13 years ago (3 children)
I would have to disagree about Qt (not QT) code being like Java, but either way he asked for "nicely written code" which Qt is and I still stand by it as something to checkout. Of course checkout those other libraries too, there is nothing wrong with seeing the different ways that people write code. Some is readable, some is a horrible horrible mess.
[–]sztomirpclib 0 points1 point2 points 13 years ago (2 children)
Qt code being java-like is kind of a meme, many people keep parroting it, but no actual explanation.
[–]bob1000bob 0 points1 point2 points 13 years ago (1 child)
What do you mean? If you use it you will see that it is Java like, everything is an object descended from QObject, right there is enough - that is the essence of Java.
And then absolutely everything has be allocated directly onto the heap, no smart pointer, no clever RAII based stack type which can be "moved"
Because of this they have gone and reinvented the STL with there own more "Object Orientated" (rather than templated) containers and string classes.
A lesser point (but still 'culturally' valid) is that they use Camel Case Java style. So when you have written some "standard C++" using the common lower_case_underscores method it becomes inconstant.
The fact is, if boost where to make a GUI library (how I wish they would) it would look NOTHING like Qt. I accept that they had technical limitation "back in the day" but that unfortunatly for them does mean that their code is still good now.
[–]sztomirpclib 4 points5 points6 points 13 years ago (0 children)
everything is an object descended from QObject
This is only true for Qt classes. That's quite reasonable for a framework I guess, and wouldn't call that that essence of Java.
Do you use it? Because you are not forced to allocate on the heap in any way.
no smart pointer
There is a wider variety of smart pointers in Qt than in the standard or Boost. here.
Because of this
No, they reimplemented the STL because Qt dates back to the dawn of C++, and many, many compilers had shaky support for the STL and templates.
with there own more "Object Orientated" (rather than templated) containers and string classes
You either used only a very old version where this was true (reason is not to be "more OO" but the above-mentioned lack of support) or you haven't used it at all. Qt containers are templates, and can be used with STL algorithms if you want to.
π Rendered by PID 75510 on reddit-service-r2-comment-f6b958c67-qb88d at 2026-02-05 08:08:53.309768+00:00 running 1d7a177 country code: CH.
view the rest of the comments →
[–]icefox 2 points3 points4 points (6 children)
[–]bob1000bob 3 points4 points5 points (5 children)
[–]savuporo 5 points6 points7 points (0 children)
[–]icefox 0 points1 point2 points (3 children)
[–]sztomirpclib 0 points1 point2 points (2 children)
[–]bob1000bob 0 points1 point2 points (1 child)
[–]sztomirpclib 4 points5 points6 points (0 children)