On 9/13/2013 7:16 AM, Chris Angelico wrote:
On Fri, Sep 13, 2013 at 8:13 PM, Steven D'Aprano
<steve+comp.lang.pyt...@pearwood.info> wrote:
On Fri, 13 Sep 2013 09:04:06 +0200, Antoon Pardon wrote:
Not only that. There are a lot of python code snippets on the net that
for whatever reason lost their indentation. There is no algorithm that
can restore the lost structure.
I believe tabs are worse than spaces with respect to getting lost.
Is there an algorithm that will restore the lost structure if you delete
all the braces from C source code?
Perhaps if web sites and mail clients routinely deleted braces, we'd see
the broken-by-design software being fixed instead of blaming the language.
While I don't deny your statement, I'd like to point out that English
usually isn't overly concerned with formatting.
Poetry, including that in English, often *is* concerned with formatting.
Code is more like poetry than prose.
You can take this
paragraph of text, unwrap it, and then reflow it to any width you
like, without materially changing my points.
But you cannot do that with poetry! Or mathematical formulas. Or tables.
Or text with headers and paragraphs and indented quotations. Etc. What
percentage of published books on your bookshelf have NO significant
indentation? As far as I know for mine, it is 0.
C follows a rule of English
which you just made up, and which is drastically wrong,
which Python breaks,
ergo software designed to cope only with English
impoverished plain unformatted prose
can better cope with C code than with Python code.
Software that removes formatting info is broken for English as well as
Python.
Python is extremely unusual in making indentation
important information
You have it backwards. Significant indentation is *normal* in English. C
in unusual is being able to write a whole text on a single line.
When I was a child, paragraphs were marked by tab indents. The change to
new-fangled double spacing with no indent seems to have come along with
computer text processing. Perhaps this is because software is more prone
to dropping tabs that return characters.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list