3 ms·
Python and C are the only language in which I have experienced that class of bugs. And that is due to if statements without brackets in C and because Python has
by jeltz 5mo ago
Python and C are the only language in which I have experienced that class of bugs. And that is due to if statements without brackets in C and because Python has meaningful indentation which people have accidentally messed up when refactoring.
And today with autofotnatters I think only Python is still vulnerable.
- zahlman 5mo agoIf 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.
- RHSeeger 5mo agoAh, 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.
- zahlman 5mo ago> 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. I genuinely don't understand how they manage this. Worst case, you paste at column 1, re-select and tab such that the baseline is appropriate for where you're pasting it, which is obvious. But more importantly, you shouldn't be copying and pasting unless you're proficient enough to fix such mistakes easily. I also don't understand how it can be argued seriously that braces avoid the problem. If you'd paste at the wrong indentation level, why would you not equally well type the wrong number of braces?
- forlorn_mammoth 5mo agoIt'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
- Sohcahtoa82 5mo agoDoes your tooling not allow you to select multiple lines of code and press Tab or Shift-Tab to indent/dedent the entire block? It usually only takes me a 1-5 seconds to fix the indentation when I copy/paste code that existed at a different indentation level. This is not something I'd complain about, personally.
- zahlman 5mo ago> 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 I don't know what to tell you. I use Vim and find it trivial to get the indentation right using my distro's stock config.