Hacker News new | past | comments | ask | show | jobs | submit login

I have to say that I find scala's syntax supremely ugly. I think Ruby's niceness comes from being to look at several lines of Ruby and say "I get that, that's nice". My reaction, looking at lines of scala, is "WTF, that's obscure yet verbose". I don't know what all the dynamics are for language acceptance but I hope to God that that scala's ugliness works to its disadvantage.

I think this has to do a lot with how people expect to think and not being able to reuse the parsers you've built up in your brain.

For example, Ruby goes for the "English" approach. E.g. the "foo.double.addOne" means "take foo, double it, then add one". You can sort of use the parts of your brain that parse natural language to read the code.

Other languages are based on various mathematical construct, such as the more functional languages where a function application is done in the opposite order of natural reading, e.g. in "1 + (2 * foo)" the "1 + " application is actually the last thing you evaluate, though it is the first thing you read. This requires you to store a lot of scope information in your mind as you parse complex expressions.

However, if you have a very strong functional language I believe it can be quite pretty in its own right as you start to think in terms of higher-order operations. For example, point-free function composition frees you from having to read additional and lengthy function declarations with their own variables and scope and lets you simply see that this composition is just a way of applying multiple functions to obtain a higher-order operation.

In short, I think it's largely about how comfortable you are to think with various mathematical abstractions that determine how ugly a language is. Note that it's possible to write ugly code in any language.

I think Ruby is great for writing code that reads like English and communicates its intent clearly, but when you need to read what the code actually does instead of what the author intended it to do, then Ruby is just as difficult to read as Scala.

I think scala partly achieves some of that "beauty" you describe, but it has made (or had to make) some compromises that make it perhaps less pure then the ideal (that means people can write things in the more imperative style just fine - not sure if thats a good things or not, but thats the way it is).

If you like point-free, you want Haskell. Scala can do it, but it's not as pretty.

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