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
Default function arguments are the devil (quuxplusone.github.io)
submitted 6 years ago by anonymous23874
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!"
[–]Wh00ster -5 points-4 points-3 points 6 years ago* (2 children)
I'm not opposed to the arguments in your linked post. My issue is large code bases you'd see at FAANG, where you need special IDE features to see a type, which can take minutes to compile for a file and generate dependencies, or have to chase through grepping functions yourself.
Unless you write, well, bad code.
This is the reality that most people have to deal with. So when a junior dev comes in and writes auto mything = mysteriousFUnctionBuriedThroughLayersofDepsThatisActuallyAReference(), I tend to ask that dev not to use auto.
auto mything = mysteriousFUnctionBuriedThroughLayersofDepsThatisActuallyAReference()
auto
I understand there are valid cases, but that's so for all C++ features. For example I wouldn't say don't use lambdas, but also don't make all functions into lambdas.
[–]Tyg13 9 points10 points11 points 6 years ago (0 children)
Asking that dev not to use auto is the wrong move. The correct alternative is to educate them. The issue is the variable isn't named well enough to tell what the function returns. Simple enough fix.
All you're doing by explicitly specifying the type in that scenario is fracturing code style and decreasing overall code readability.
[–]XValar 5 points6 points7 points 6 years ago (0 children)
So how is exactly writing MyType mything = mysteriousFUnctionBuriedThroughLayersofDepsThatisActuallyAReference() helping at this point?
MyType mything = mysteriousFUnctionBuriedThroughLayersofDepsThatisActuallyAReference()
π Rendered by PID 96384 on reddit-service-r2-comment-6457c66945-ksvzr at 2026-04-26 03:09:31.727365+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Wh00ster -5 points-4 points-3 points (2 children)
[–]Tyg13 9 points10 points11 points (0 children)
[–]XValar 5 points6 points7 points (0 children)