Yesterday, I shared some spicy takes. A few were particularly controversial—most notably, that I correct Gif the correct way (with a soft G)—but I also got a lot of emails asking me to elaborate on a few of them.
Today, I wanted to talk about how tabs are objectively better than spaces. This won’t take long.
Tabs let you define how big you want each indent to be, and spaces do not.
Actually I think you can technically mix. They have a “conversion factor”. But don’t, because then the code will look like crap on any other tab size (defeating the point of using tabs in the first place)
I think it would be better that each line needs to start with the exact same bytes to be considered within the same indent level. But I don’t think that is the decision Guido made.
Python noob here. I thought you were only supposed to use spaces with python and tabs would give you indentation errors?
Tabs work fine, you aren’t allowed to mix, indentation must be consistent.
Actually I think you can technically mix. They have a “conversion factor”. But don’t, because then the code will look like crap on any other tab size (defeating the point of using tabs in the first place)
I think it would be better that each line needs to start with the exact same bytes to be considered within the same indent level. But I don’t think that is the decision Guido made.