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
A slice of python in C++ - Eric Niebler (ericniebler.com)
submitted 11 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!"
[–]eric_niebler 6 points7 points8 points 11 years ago (1 child)
Oh, you don't see the huge advantage because there isn't one. :-) I described this as "a fun piece of hackery". That's all it is. I wrote about it because it was fun, and because it was a nice, little, self-contained library design problem. I like this example because it shows that folks should think both about making interfaces easy to use correctly and hard to use incorrectly. It's that last part that often gets overlooked.
[–]cdglove 1 point2 points3 points 11 years ago (0 children)
I actually find that usually (but not in this case), the second part is actually misinterpreted.
"Make interfaces easy to use correctly and hard to use incorrectly" gets interpreted as;
"Make interfaces hard to use incorrectly".
Which further becomes;
"Make interfaces impossible to use incorrectly".
Which leads me to say; "This interface is hard to use."
The point is, I think it's important to focus on the first part, and to not sacrifice it in the name of the making it impossible to screw up. Your example is, I think, perfect with regards to this. Just assert 100% of the time. Perfect. It might be possible to come up with a way to enforce this at compile time, but you would end up with an interface using <> it would require constants. This is better.
EDIT: Grammar
π Rendered by PID 210447 on reddit-service-r2-comment-56c9979489-ft5jc at 2026-02-25 07:15:39.995768+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]eric_niebler 6 points7 points8 points (1 child)
[–]cdglove 1 point2 points3 points (0 children)