crazy programming language thoughts
hancock at anansispaceworks.com
Fri Aug 22 15:47:08 CEST 2003
Istvan Albert wrote:
> Ryan Lowe wrote:
> >>>>v = read lines from 'file.txt';
> join it with '\n'; lower it; split it at '.'
> split line at '\n' is no better than line.split("\n")
> after all then you could argue that you should be
> able to say "'\n' is the splitting character in line" or
> "break into pieces at '\n'" and so on.
Yeah, I think this is ultimately the problem with "English-like"
syntax. The fact that Python's syntax (one of many examples)
is more like mathematical notation is a cue to both the author
and the reader that a more exacting attention to syntax is
required. Maybe this is what they really meant by "one obvious
way to do it" versus "there's more than one way to do it": in
English there are many -- maybe infinitely many -- ways to say
essentially the same thing.
But a parser that could understand them all would pass the
Turing Test and want a paycheck. ;-)
Of course, it is interesting to note that it is the *author* who
primarily needs this cue. The *reader* benefits from using English
words instead of abstract symbols. So perhaps this is why
Python's mix of syntax works well -- not too hard to write, and
not too hard to read. I'm not even going to speculate about
whether it is the best such mix. ;-)
The main language I use that resembles the "English" style
SELECT * FROM table_a WHERE field_b LIKE '.*[abc][def]'
and while I find SQL very useful in its limited application
domain, I wouldn't really want to turn it into a real
*By which I meant "Turing Complete" and nothing else. And
no value judgements whatsoever. :lol:
Anansi Spaceworks http://www.AnansiSpaceworks.com/
More information about the Python-list