3 ms·
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 tryi
by Goladus 19y ago
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.
- ced 19y ago-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.
- mojuba 19y agoPhilosophically 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.
- eru 19y agoSource code is still nearly universally viewed in non-proportional fonts.
- DocSavage 19y ago- 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.
- Goladus 19y agoThat's actually a valid issue, and not really addressed by the article. Cutting and pasting does occasionally require some extra care.