Chris Lattner
๐ค PersonAppearances Over Time
Podcast Appearances
I think that the indentation is beautiful, but that's not a rational explanation.
But I can defend it rationally.
So first of all, Python 1 has millions of programmers.
It is huge.
It's everywhere.
It owns machine learning.
So factually, it is the thing.
Second of all, if you look at it, C code, C++ code, Java, whatever, Swift, curly brace languages also run through formatting tools and get indented.
And so if they're not indented correctly, first of all, it will twist your brain around.
It can lead to bugs.
There's notorious bugs that have happened across time where the indentation was wrong or misleading and it wasn't formatted right.
And so it turned into an issue, right?
And so what ends up happening in modern large-scale code bases is people run automatic formatters.
So now what you end up with is indentation and curly braces.
Well, if you're going to have
you know the notion of grouping why not have one thing right and get rid of all the clutter and have a more beautiful thing right also you look at many of these languages it's like okay well you can have curly braces or you can omit them if there's one statement or you just like enter this entire world of complicated design space that objectively you don't need if you have python style indentation so yeah i would love to actually see statistics on errors made because of indentation
I think it's probably pretty minor because once you get, like you use VS Code, I do too.
So if you get VS Code set up, it does the indentation for you generally, right?
And so you don't, you know, it's actually really nice to not have to fight it.
And then what you can see is the editor is telling you how your code will work by indenting it, which I think is pretty cool.