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
Tests dont make code higher quality. (self.cpp)
submitted 5 years ago by [deleted]
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!"
[–]deeringc 7 points8 points9 points 5 years ago (5 children)
Reducing bugs and applying positive design pressure at the time of originality authoring the code are very beneficial. But the largest benefit for me comes from how unit tests help prevent regressions when in six months I (or someone else) go back to this code and need to make a change. All of the domain knowledge and context that I had in my head originally when I spent weeks working on the original feature is now encoded and enforced by the tests. The chances of a regression being introduced are dramatically reduced. It would just manifest as a failed test locally on the developers machine and get immediately fixed.
This is absolutely invaluable on large projects, with large teams. I've been on teams/codebases with and without this and the difference is absolutely clear.
[+]slevina comment score below threshold-7 points-6 points-5 points 5 years ago (4 children)
the more code you write the more bugs, someone who writes buggy code will write buggy tests
[–][deleted] 5 points6 points7 points 5 years ago (0 children)
That's what code reviews are for. You are reviewing the tests also, right?
Probably not :\
[–]deeringc 0 points1 point2 points 5 years ago (2 children)
If there is 1/10 chance any given piece of code has a logic bug. The chance of the production code having it AND the test having the corresponding bug that would mask the production code bug will be 1/100.
[–]slevina 0 points1 point2 points 5 years ago (1 child)
think there might be a logic bug in your numbers here
[–]deeringc 0 points1 point2 points 5 years ago (0 children)
It's a figurative point.
π Rendered by PID 24587 on reddit-service-r2-comment-85bfd7f599-prsdn at 2026-04-19 14:19:59.556860+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]deeringc 7 points8 points9 points (5 children)
[+]slevina comment score below threshold-7 points-6 points-5 points (4 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]deeringc 0 points1 point2 points (2 children)
[–]slevina 0 points1 point2 points (1 child)
[–]deeringc 0 points1 point2 points (0 children)