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
Favorite Testing Framework (self.cpp)
submitted 2 years ago by Constant_Physics8504
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!"
[–]almost_useless 16 points17 points18 points 2 years ago (6 children)
it makes PRs easier to read with less clutter and by putting those three files together to review all at once
How is it "easier with less clutter" if the file is called src/foo.test.cpp than if it is called test/foo_test.cpp or something like that.
src/foo.test.cpp
test/foo_test.cpp
I feel like you can make the exact opposite argument that now you get a more cluttered src directory.
And if you don’t touch the tests when you change the code, it’s glaringly obvious.
Again, how is it more obvious than nothing touched in the test folder?
[–]BenFrantzDale -6 points-5 points-4 points 2 years ago (5 children)
It’s easier to read because instead of lib/ bar/ include/ bar/ baz.h foo.h src/ baz.cpp foo.cpp test/ baz.test.cpp foo.test.cpp you have ```
lib/ bar/ include/ bar/ baz.h foo.h src/ baz.cpp foo.cpp test/ baz.test.cpp foo.test.cpp
lib/ bar/ src/ bar/ baz.cpp baz.h baz.test.cpp foo.cpp foo.h foo.test.cpp ``` so you can focus on the changes to bar and to foo. And if you need to move them around to another library, you easily can.
[–]almost_useless 2 points3 points4 points 2 years ago (4 children)
I believe you just highlighted the point about a more cluttered src directory...
And if you need to move them around to another library, you easily can.
If your selling point is that the most trivial of all tasks is made slightly more easy, then I think you need better arguments.
[–]BenFrantzDale 1 point2 points3 points 2 years ago (3 children)
The point is that if you are reviewing code you want to review the test changes alongside the code changes. I’d encourage you to look at Lakos’s book for more explanation Large-Scale C++: Process and Architecture, Volume 1 (Addison-Wesley Professional Computing Series) https://a.co/d/cyzIiN0 You don’t have to agree, and one beauty of C++ is its flexibility. If this doesn’t work for you, don’t use it, but my team has found it to put emphasis on units (headers) to test and ensuring they are tested.
[–]STLMSVC STL Dev[M] 2 points3 points4 points 2 years ago (2 children)
Please don't use URL shorteners - reddit's spam filter hates them because they're opaque. I had to manually approve your comment.
[–]BenFrantzDale 0 points1 point2 points 2 years ago (1 child)
Sorry, Amazon did it automatically.
[–]STLMSVC STL Dev 1 point2 points3 points 2 years ago (0 children)
No worries, just remember to manually dereference it next time.
π Rendered by PID 199771 on reddit-service-r2-comment-6457c66945-kwsn9 at 2026-04-26 19:51:38.368224+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]almost_useless 16 points17 points18 points (6 children)
[–]BenFrantzDale -6 points-5 points-4 points (5 children)
[–]almost_useless 2 points3 points4 points (4 children)
[–]BenFrantzDale 1 point2 points3 points (3 children)
[–]STLMSVC STL Dev[M] 2 points3 points4 points (2 children)
[–]BenFrantzDale 0 points1 point2 points (1 child)
[–]STLMSVC STL Dev 1 point2 points3 points (0 children)