3 ms·
> Indent 2 spaces It's interesting how quickly the 2-space indent became the new norm
by dvfjsdhgfv 9y ago
> Indent 2 spaces
It's interesting how quickly the 2-space indent became the new norm
- ma2rten 9y agoAll Google style guides use two spaces.
- fernandotakai 9y agonot the python one! https://google.github.io/styleguide/pyguide.html https://google.github.io/styleguide/pyguide.html anything other than 4 spaces for python look out of place for me.
- bru 9y agoThis is either outdated or only for the public version of the guide: the internal guide, and all our python code, has 2-spaces indents.
- teddyh 9y agoMeanwhile, the rest of the Python world probably follows PEP8, which uses 4 spaces. https://www.python.org/dev/peps/pep-0008/#indentation https://www.python.org/dev/peps/pep-0008/#indentation
- GavinAnderegg 9y agoI've seen a lot of Python from Google using two spaces, which I find very hard to read. Many of the samples here use two-space indentation: https://github.com/google/google-api-python-client/blob/master/samples/README.md https://github.com/google/google-api-python-client/blob/mast... Here's a specific example: https://github.com/google/google-api-python-client/blob/master/samples/coordinate/coordinate.py https://github.com/google/google-api-python-client/blob/mast...
- andrewmcwatters 9y agoI'm very curious about why. In 8-space tab sizes, you have to very, very carefully think about what you're fitting on that 80-col line after having in most cases, already removed 10% of your column space. A lot of C resulted in single character variable names and abbreviations that sacrificed immediate readability, but with domain knowledge that gets resolved with time. On the flip side of things, you have developers who universally write 240+ col lines in HTML and don't know what a punched card is.
- saagarjha 9y ago…I'm not seeing a strong argument for either in your response.
- dexterdog 9y agoYeah, I'm not following that one. 2-space tabs are visually difficult.