Hacker News new | ask | show | jobs
by pmontra 2136 days ago
It does well but I'm not happy when I move code around and have to manually fix the indentation level at destination and check if I inadvertently broke an if or some loop. My editor does it for me with other languages and I have one less source of bugs.
1 comments

I've noticed editors auto fixing Python indentation while copy-pasting. I think VSCode does it, so it's definitively a solvable problem :-)

(I've disabled this feature in my main editor for a long time though, so I'm used to hit Tab/Shift+Tab as many times as needed when pasting)

VS Code tries to do it, but it’s heuristic based and generally fallible. (Disclaimer, work on vscode, not on python extension)

I much prefer working in languages wherein the series of tokens absolutely defines the semantics (as opposed to Python where the series of tokens + the context define the semantics)

Yep, but no editor can decide if the code must align with the last line of a loop or be indented out of the loop. I got at least one bug in production because of that, and a test that didn't catch the error.