3 ms·
Google's C++ style guide is much more interesting: https://google.github.io/styleguide/cppguide.html https://google.github.io/styleguide/cppguide.html
by orian 10y ago
Google's C++ style guide is much more interesting:
https://google.github.io/styleguide/cppguide.html https://google.github.io/styleguide/cppguide.html
- catnaroek 10y agoIn that it destroys a greater proportion of the language's expressive power? :-p
- jsolson 10y agoIt has improved considerably since the adoption of (much of) C++11. Still no exceptions, though.
- adrianratnapala 10y agoThe advantage of exceptions is not so much their "expressive power", but the fact that they provide an approximation to error handling even when nobody remembers to express it. If my team had some process (via code review, static analysis, or anything else) that could ensure error returns were actually checked and handled, then the case for exceptions would be much diminished.
- jsolson 10y agoI mostly agree. We do have that in the form of static analysis, Status and StatusOr return types, and MUST_USE_RESULT (which is also visible in external codebases like V8). There's still a fair amount of boilerplate, but on the other hand control flow transfers are explicit, so it's a trade-off.
- catnaroek 10y ago> some process Or something like Rust's `Result<T,E>` type? You can't possibly forget to `match` it, and if you `unwrap` it, it will be plain obvious, both to humans and to linters. http://doc.rust-lang.org/std/result/index.html http://doc.rust-lang.org/std/result/index.html