Does anyone know why Google's coding standards (C++ Style Guide e.g. but I think the same applies to others as well) use 2 spaces for indentation instead of 4?
The only reason I can think of is deeply nested code: with 4 spaces and a sufficient amount of nested if
, loops or whatever, the leftmost half of your monitor will be obviously blank, if you're using a low resolution.
Personally I would always prefer 4, but I can see why somebody might want less than that while writing HTML, for instance.
Personal preferences really - most editors will use 4 spaces by default.
精彩评论