Python Style Guide from Google
google.github.io
google.github.io
Imagine this diff in the middle of a file (in Javascript)
if (includes(users, userId)) {
open(load(userId))
}
vs if (_.includes(users, userId)) {
Modal.open(UserApi.load(userId))
}Still no exceptions, though.
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.
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.
Lines longer than 100 chars are very rare in readable code. And it is easy to break lines down to 80 or even 72. If you do that, then it becomes easy to place two windows of good sized text side-by-side.
In my experience, any Python code in the core codebase follows the (internal) style guide. Big mostly-standalone projects like YouTube have their own style.
Also, you don't need to type 4 (or however many) spaces directly. Most programming editors can be configured to insert spaces when you press tab, or to replace existing tabs in a file to spaces.
What is the advantage that spaces have over tabs?