4 ms·
People bitch about indentation in Python. But in this case it would have prevented the bug! Of course Python doesn't even have a goto, so the code would have n
by PhantomGremlin 13y ago
People bitch about indentation in Python. But in this case it would have prevented the bug!
Of course Python doesn't even have a goto, so the code would have needed to be structured differently to start with.
If I were a betting man I'd wager that this bug wasn't really an accident. It would be really interesting to check commit logs to see the history.
- wreegab 13y ago> People bitch about indentation in Python Really? I did something in Python for the first time a while ago and the indentation as code block is something I find very elegant. I can't fathom why would people find something wrong with this.
- baq 13y agoit's relatively harder to refactor code - you can't just select between { and }. otherwise, no idea - python is my weapon of choice, so i may be biased.
- rplnt 13y agoCan't really write onliners. And use of otherwise great interactive shell is not as good (not that bracketed blocks would help).
- schnable 13y agoStyle guideline of using curly braces with ALL if statements, even one liners, would have gone a long way to prevent this.
- lzhz 13y agoCode reviews and comprehensive test suites for critical code would have prevented this and many other kinds of mistakes besides.