logoalt Hacker News

zahlmantoday at 8:47 AM2 repliesview on HN

If you are messing up indentation accidentally during refactoring there is either something wrong with your tooling (including your text editor) or you are letting things get too far out of hand before starting the refactoring.


Replies

forlorn_mammothtoday at 1:41 PM

It's 2026. I'm using Jupyter notebooks in Databricks. Guess what my tooling (including my "text editor", the Jupyter notebook), does not do?

Yes, I can castle-[ to shift a block of code left or right, but this is not always problem-free nor is it automatic nor does it have any sense of where the indents should go.

Yes, there is a "format python properly" button which often errors out says "there is an indentation error in your python so I cannot automatically indent it"

Would I like to use better tooling? I present my .vim file as evidence. Am I using what they tell me is state of the art? yes. And in 2026, state of the art does not solve python indenting, because python indenting is inherently a broken paradigm

RHSeegertoday at 12:49 PM

Ah, the old "you're doing it wrong" argument. Moving code from one place to another (copy/paste from online or just from one file to another) is a fairly common source of bugs for a lot of people when it comes to Python. At some point, it becomes clear is an issue with the language, not the people.

I enjoy Python, but the significant whitespace is _not_ one of the reasons.