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

So your biggest complaint is "Scala doesn't look like Python"? I mean, I love Python, but indentation-based syntax isn't that great. I think Scala is fine as it is.



Being brutally honest, compared to Haskell, ML and to a lesser extent Python, Scala's syntax is rather ugly and unnecessarily verbose. I'm almost certain its creators chose the syntax in order to tempt curly-bracket programmers, not because they liked it personally. I really hope that future high-level languages will use better syntax and move on from the C/C++ influence.


> compared to Haskell, ML and to a lesser extent Python, Scala's syntax is rather ugly and unnecessarily verbose

I have never worked extensively with Haskell or ML, but what I can say is that Scala's syntax is better than that of most other mainstream languages.

Three of Scala's syntax niceties are:

1) No semicolons

2) No braces required for one-line functions

3) No constructor required: instance arguments passed in class declaration


To add onto this, its not one line functions but rather functions whose body is a single expression.

You can do a big for comprehension, or a if/else, or a big chain of function calls, etc. without having to add brackets.

In practice you often end up not really using braces that often when writing FP style Scala.


The constructor syntax can be a source of confusion. People have to be taught that the class declaration parameter list is actually the primary constructor, and that the body of the class is also the body of the primary constructor, except for any method definitions, some of which may be secondary constructors!

Scoping is hard.


As someone who likes both FP and curlies, I for one am glad to have at least one language that caters to that combination of preferences.


I don't think it's fair to refer to Scala's syntax non-specifically like that. Scala allows you to write code that looks like Java or code that looks closer to Haskell. It's a very wide spectrum.

You're probably referring to the worst of Scala.

Personally, I don't find expression-centric, brace-less Scala to be "rather ugly".




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

Search: