News for hackers. Stuff that matters.
Re:Boring Python: Code Quality by gjulianm on Tuesday December 20, 2022 @07:19AM (#34064884)
Yes. The code started as being indented by tabs, so changing it now is a mess. Also, not to start a flamewar, but I've always preferred tabs to spaces in any language, I find them more reliable, easier to use...
Re:Boring Python: Code Quality by drcongo on Tuesday December 20, 2022 @08:04AM (#34065282)
Not going to argue about your personal preference, but in Python spaces for indentation isn't just a personal preference - you'll run into a fair amount of issues with that, this one being just the tip of the iceberg.
Re:Boring Python: Code Quality by gjulianm on Tuesday December 20, 2022 @08:34AM (#34065618)
Apart from isort not knowing how to deal with tabs, and changing the defaults "spaces" to "tabs" in the tools (along with line length too, because for some reason the 80 character limit is set in stone even though it's absolutely outdated) I haven't had many issues. And this has been running for years already.
Re:Boring Python: Code Quality by dontlaugh on Tuesday December 20, 2022 @09:10AM (#34066099)
Not necessarily. Consistently indenting with tabs and aligning with spaces does work, but is tricky to enforce.
Re:Boring Python: Code Quality by Stratoscope on Tuesday December 20, 2022 @12:05PM (#34068766)
The key to success with tabs in any language is simple: Don't use alignment.

Instead, only use indentation.

It is interesting to note that Black-formatted code uses indentation only and never uses alignment. It would be perfectly compatible with tabs, unlike Google-formatted code which relies heavily on column alignment.