Guido van Rossum
๐ค PersonAppearances Over Time
Podcast Appearances
in a complex business document and inside some of the bullets are other bulleted lists, you will indent those too.
If each bulleted list is indented several inches, then at two levels deep, there's no...
no space left on the page to put any of the words of the text.
So you can't indent too far.
On the other hand, if you don't indent at all, you can't tell whether something is a top-level bullet or a second-level bullet or a third-level bullet.
So you have to have some compromise.
And based on ancient conventions and sort of the typical width of a computer screen in the 80s,
and all sorts of things sort of
We came up with sort of four spaces as a compromise.
I mean, there are groups, there are large groups of people who code with two spaces per indent level.
For example, the Google Style Guide, all the Google Python code, and I think also all the Google C++ code is indented with only two spaces per block.
If you're not used to that, it's harder to, at a glance...
understand the code because the sort of the high level structure is determined by the indentation.
On the other hand, there are other programming languages where the indentation is eight spaces or a whole tab stop in sort of classic Unix.
And to me, that looks weird because you sort of after three indent levels, you've got no room left.
It doesn't have to be four spaces.
So you can code Python with two spaces per block or six spaces or 12 if you really want to go wild.
But sort of everything...
that belongs to the same block needs to be indented the same way.
In practice, in most other languages, people recommend doing that anyway.