def foo():
longvariable = 1
x = 2
Also on the subject of lambdas, this is also valid: def foo():
def bar(x):
return x + 5
print bar(5)
With a nice clean syntax for nested functions, lack of multi line lambdas is much less of an issue.This is perfectly valid in Python:
users = [ # Name ID Age Phone
['John', 5, 37, '555-1234'],
['Bill', 5, 29, '555-4321'],
['Jean', 5, 32, '555-4132'],
]
Edit: Always a good idea to test even the simplest snippets before posting them...http://www.python.org/dev/peps/pep-0008/
I'd do it just like you do though.
I find it visually harder to fish those equals signs out of the 'noise' otherwise.
longvariable, x = 1, 2
However this won't work: longvariable, x = 1, foo(longvariable)
So I like to keep things uniform regardless of the rvalue. Also violating the style guide, I like longvariable = "hello" # some description of longvariable
x = 1 # some descrption of xVery neat syntax!
He probably could write an interesting clojure piece - if only he left out the uninformed ranting.
What you can do is compare experiences using a given language. E.g. "Our project using language N went quite well", or "I had a good time in Mexico".
Debating the syntax of for-comprehensions, or the value of the subjunctive, may be fun, but it never really leads anywhere.
Is English or Spanish a better language to communicate in for a specific purpose, just like is Python or Clojure a better language to achieve a certain goal in.
So, without the context of that goal a comparison is meaningless.
But, let's say we create a certain application (let's say an accounting program, or a spreadheet) in both clojure and python, feature-for-feature identical, user interface identical and so on, then a comparison becomes possible.
How long did it take to complete the project ?
How easy is it to change the program to conform to some new specification ?
How fast does it execute ?
And so on. It all boils down to the old benchmark problem, a benchmark in a vacuum is meaningless, you have to test using real applications.
But it is rather pointless to debate languages in isolation ("Spanish verb conjugations must lead to more powerful novels", or somesuch).
The same applies to programming languages, I think.
I'm no great fan of some of pythons choices but I think if you find x things wrong with python and 0 wrong with clojure that that is fairly indicative that this is not a balanced review.
Which is a pity.