How clean/elegant is Python's syntax?

Cameron Simpson cs at zip.com.au
Wed May 29 18:12:07 EDT 2013


On 30May2013 02:13, Ma Xiaojun <damage3025 at gmail.com> wrote:
| For the core language, I have mixed feeling. On one hand, I find that
| Python has some sweet feature that is quite useful. On the other hand,
| I often find Pyhton snippets around hard to understand.

I think you will find that is lack of practice. I find Python far
far easier to read, even in snippet form. BUT, for years I found
it obtuse because I hadn't learnt it. Now that I have, I rarely
want to use other things (if Python is apt; often but not always).

| I admit that I
| never learned Python very formally; I've programmed in many other
| languages already.

Me too. Use it some more.

| Code snippets in BASIC or Pascal seems quite obvious to understand
| (Unless I don't understand the algorithm) .

Code in BASIC is generally lower level than python; it is less
expressive.  Because of this, it will be more obvious in terms of
being more direct. But it will be less expressive because you will
often need more BASIC to do something than you would with Python.
So python is usually more succinct, and therefore more more expressive:
a shorter but very readable way to do the same thing.

Comparison: your English is excellent. Presuming from context that
you're in China, many of your compatriots do not speak fluent English
(and why should they?) For those speaking English as a second
language there are difficulties; English grammar I gather is very
different, and it has a fine suite of irregular forms. (Let me say
up front that I do not speak Chinese at all.)

Anyway, would you rather converse with someone fluent, or not? I
would expect you would far rather deal with a fluent English speaker
or a fluent Chinese speaker than a speaker using English badly.

Python code is a lot like written English. BASIC is like badly
written English.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au>

Helicopters are considerably more expensive [than fixed wing aircraft],
which is only right because they don't actually fly, but just beat
the air into submission.        - Paul Tomblin



More information about the Python-list mailing list