Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The author seems to be strongly biased against python.

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.



Not only that, he's wrong - Python is sensitive to indentation, not whitespace. As long as your block is at the right depth, you can have as much whitespace as you want. I regularly format code so similar things line up. This is perfectly valid Python:

    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.


To give an example in reply to the Clojure snippet that is now mysteriously missing from the article (to demonstrate something Python users should be jealous of)...

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...


Tell me about it :) Three lines, 5 bugs I think is my record to date.


Interesting how your variable example is pretty much straight against the python styleguide:

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.


In the wild, you're more likely to find Python that looks like:

    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 x


This reminds me of my high school algebra teacher. He would automatically fail you in tests if your equals did not line up.

Very neat syntax!


From the blog - "I'm a professional freelancer working exclusively in Clojure."


Which is not really an excuse for bashing a language on your blog that you clearly haven't even used beyond a hello-world...

He probably could write an interesting clojure piece - if only he left out the uninformed ranting.


I think if you want to do a meaningful comparison of two programming languages you should be about as proficient in both.


I'm not sure meaningful comparisons of programming languages are even possible. It's a bit like asking if English is better than Spanish.

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.


I think that it is not like 'is english better than spanish', I think it can be:

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.


Then we agree, I think. My point is that it is quite possible, even easy, to describe experiences with a language ("It was easier to communicate in Spanish in Madrid").

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.


He did the same sort of hatchet job on Scala a month ago.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: