Hacker News new | ask | show | jobs
by mrazomor 1366 days ago
"no exceptions" is one of the best parts of Google style guide, IMO. Note that, banning of exceptions introduced returning status (error codes done right). It makes it easier to follow the code and makes the code more readable (but, you need a few macros, unfortunately).
2 comments

In a language like C++ returning status codes means that callers can and will ignore it, even when they shouldn't.
Since C++17, using [[nodiscard]] can help with that.
Indeed, Google's implementation of Status/StatusOr requires explicit handling of those objects, they cannot be discarded automatically.
OK if you like 10-15% performance loss off the top.

And incompatibility with the rest of the world.