3 ms·
> start putting in all the 'fluff' like indenting their code One of the many nice things about Python is that whitespace - specifically, indenting - is signifi
by RyanMcGreal 16y ago
> start putting in all the 'fluff' like indenting their code
One of the many nice things about Python is that whitespace - specifically, indenting - is significant.
- samratjp 16y agoAnd that feature alone makes for readability in large projects :-)
- p_nathan 16y agoI've had multiple bugs based on whitespace being significant. A C-descended language which had braces around the block would not have had the bug at all. Another problem with it is that I can't just comment out, say, an if, and have the code under it run automatically. I have to go through and reformat the business, leading to potential bugs. This also plays into refactoring as well. Basically, I find the whitespace rule something that should have been left in the 60s with punch cards. I am not a fan of Python. I consider Common Lisp and Perl to be fundamentally less ambiguous languages.
- RyanMcGreal 16y ago> I've had multiple bugs based on whitespace being significant. Interesting. In several years programming with Python, I've had exactly zero bugs based on whitespace being significant. > I can't just comment out, say, an if What I do is comment out the if statement and add another if statement under it, like so: #if condition: if 1 == 1: # FIXME temp code for testing do_something() I always grep my code for FIXMEs before pushing to production, and have my text editor configured to highlight FIXMEs and TODOs.