> You simply don't get to make these mistakes in Python.
That's actually wrong.
When a tab sneaks in you so get to make those mistakes and there is
nothing that visually tells you anything. Things line up neatly,
but don't actually work.
In C you don't get to make those mistakes. If it's important
then you can see it.
Posted Apr 5, 2013 6:19 UTC (Fri) by smurf (subscriber, #17840)
[Link]
So set up your editor that your tabs actually do the same thing, visually, that Python thinks they do logically. Simple.
Or tell your editor to not use tabs at all. Again, simple.
Or tell your editor not to use spaces (i.e. ony Python indent == 1 tab) and make the tabs wide enough that you can't miss any misalignment.
The Python community has more-or-less agreed on the second option; personally I strongly prefer the third. But that's as much bikeshedding as whether a C open brace goes on the same line as the if statement, or below it (and if so, which indent does it get?)
This kind of mistake (mixing up tabs and spaces) is so easy to check for that Python actually has an option for it. Which C compiler checks for "wrong" indentation on nested statements?
PyCon: Evangelizing Python
Posted Apr 5, 2013 7:02 UTC (Fri) by dlang (✭ supporter ✭, #313)
[Link]
any language that requires me to have a specific configuration in my editor to use the language is not a reasonable choice.
If you are a full-time programmer who works in a nice, dedicated environment, you may end up with a nice tailored config.
But, like most sysadmins, I have to support software on all sorts of systems, many of which I haven't ever touched 5 minutes before I'm working on the code.
by the way, this is why I'm a vi person. every system has some variation of vi that I can run to get the job done. other editors, it's not the same thing.
PyCon: Evangelizing Python
Posted Apr 5, 2013 8:42 UTC (Fri) by intgr (subscriber, #39733)
[Link]
> there is nothing that visually tells you anything
Note that this is fixed in Python 3, it gives you a "TabError: inconsistent use of tabs and spaces in indentation"