Namespaces
Variants
Actions

User talk:FJW/mainpage

From cppreference.com

That's not really what optional is for. Yes, sure, it can be used that way, but that's not really what it's for. Why not include it in the standard library section, and just mention that error handling is one of the ways it can be used?

A better idea for the error handling section might be to have one page for exceptions and one page for "other", where you mention error return codes (both via return or via reference argument), optional, and whatever else.

Even better, ditch the "error handling" section and just have a section "exceptions", then use multiple pages within that section to build up from basic try-catch (triggering exceptions in the examples by out-of-bounds vector.at() calls, for example), to throwing, to standard exceptions, to custom exceptions, to noexcept, etc..

Generally speaking, I don't think it's cool to give newbies the idea that exceptions are avoidable. Yes, they technically are, but you really shouldn't be programming that way unless you're writing low-level or lightning-fast code - neither of which are newbie stuff anyway.--Indi (talk) 22:18, 4 November 2013 (PST)