News for hackers. Stuff that matters.
Re:Python indentation: very nice explanation for the curious... by eru on Friday September 21, 2007 @06:34AM (#57887)
I never understood why some people are so adverse to python's indentation rules. But maybe that's because I was too young when I was introduced to python.
Re:Python indentation: very nice explanation for the curious... by Goladus on Friday September 21, 2007 @09:32AM (#57927)
I think it's sort of presumed by the article, but there are a few things people worry about when they hear "significant whitespace"

-They remember pain of trying to find an error in a code, data, or config file that had significant whitespace. Consider the 'tab-delimited' spreadsheet format, for example. If you manually edit a tab-delimited list of numbers, and accidentally leave a space somewhere, the number might be read as a string.

-They've spent a lot of time dealing with HTML rendering, where whitespace gets mangled and cannot be trusted.

-They're afraid they won't be able to make their code readable.

-They're afraid that the whitespace rules will be complicated, requiring them to think constantly while adjusting to this newfangled way to delimit blocks.

Re:Python indentation: very nice explanation for the curious... by ced on Friday September 21, 2007 @11:50AM (#57970)
-They've used Fortran 77 which requires 6 whitespaces before a normal statement, 5 + any character for line continuations, and which truncates silently (as in, without warning) any line longer than 72 characters.
Re:Python indentation: very nice explanation for the curious... by mojuba on Friday September 21, 2007 @11:59AM (#57971)
Philosophically speaking, we live in a world where the number of spaces doesn't matter anymore (although it did matter in those pre-historic pre-Internet times). Spaces may be lost in HTML, in word processors or in an editor that accidentally wasn't tuned for Python. However neat and readable it is, just try to show your code, for example, on some minimalist web forum like this one. It's too bad you can't, isn't it?

It is also true that Python has survived already, but I doubt this concept would leak to new languages.

Upd: In other words, it's electronic typography that made the space character irrelevant.

Re:Python indentation: very nice explanation for the curious... by eru on Monday September 24, 2007 @04:33AM (#58811)
Source code is still nearly universally viewed in non-proportional fonts.
Re:Python indentation: very nice explanation for the curious... by DocSavage on Friday September 21, 2007 @02:02PM (#58020)
- They don't like the idea that cut & paste of code snippets will break the code due to significant indentations. Counter-arguments include (1) you should probably beautify the code anyway and check for issues while doing it, (2) code snippets should be in modules with smallish functions.
Re:Python indentation: very nice explanation for the curious... by Goladus on Friday September 21, 2007 @02:22PM (#58028)
That's actually a valid issue, and not really addressed by the article. Cutting and pasting does occasionally require some extra care.