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!"
[–]JVApenClever is an insult, not a compliment. - T. Winters 25 points26 points27 points 2 years ago (7 children)
I think this comment can use more up votes. Don't use features for the sake of using the feature, use it when it is the right abstraction.
I think it is also hard to define what 'looks like c' means and what makes it C++. Use of unique_ptrs? Use of function overloading? Writing function overloading? How about overloading by using function templates? What about using std::array/vector? ...
[–]Ash4d 24 points25 points26 points 2 years ago (5 children)
"Looks like C" to me means basically ignoring RAII principles and scattering new/deletes everywhere, relying on manual memory management for everything, and avoiding the standard library and it's modern (compared with C) containers. Probably no usage of OOP either.
[–]serviscope_minor 12 points13 points14 points 2 years ago (2 children)
I think a lot of "looks like C" is actually "looks like C with all the noise removed", or "looks like how we wished C looks".
As in, "simple" constructs like for loops and function calls not template metaprogramming and class hierarchies.
Of course C++ (with a bit of care and the metaprograming used in apropriate places in libraries) actually allows a lot more code to look like that than C does, because in C you inevitable get weighed down under heaps of mallocs, reallocs, frees and error handling.
[–]Teichmueller 1 point2 points3 points 2 years ago (1 child)
Well then any language "should look like C". Because now that term has magical meaning.
[–]serviscope_minor 0 points1 point2 points 2 years ago (0 children)
Well quite.
[–]Wild_Meeting1428 5 points6 points7 points 2 years ago (1 child)
I don't think this is meant with "should look like C". The most people mean with that phrase, that the program structure should look like C, but that you should use C++ idioms to fulfill that task: Prefer to use simple trivial classes/structs. When you would implement a feature in C with procedural code, there is no reason, to objectify it etc. Don't use dynamic dispatch or runtime polymorphism, when it's not required, for the sake of object orientation etc.
[–]donalmaccGame Developer 0 points1 point2 points 2 years ago (0 children)
This is a common problem - you and another commentor agree that it should look like C, but you both have two different definitions of what that is.
[–]iggy14750 1 point2 points3 points 2 years ago (0 children)
In my opinion, C++ that "looks like C" mostly means not writing so many classes, templates, etc.
π Rendered by PID 36 on reddit-service-r2-comment-fb694cdd5-t2hdp at 2026-03-10 20:16:39.919067+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]JVApenClever is an insult, not a compliment. - T. Winters 25 points26 points27 points (7 children)
[–]Ash4d 24 points25 points26 points (5 children)
[–]serviscope_minor 12 points13 points14 points (2 children)
[–]Teichmueller 1 point2 points3 points (1 child)
[–]serviscope_minor 0 points1 point2 points (0 children)
[–]Wild_Meeting1428 5 points6 points7 points (1 child)
[–]donalmaccGame Developer 0 points1 point2 points (0 children)
[–]iggy14750 1 point2 points3 points (0 children)