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

If that's true, then Scala was simply specified less precisely than Java. As lemming said, Scala is a massive superset of Java's functionality.

Off the top of my head, I can rattle off a slew of functionality in Scala that's not in Java:

* Regexp literals

* partial/curried functions

* for comprehension

* argument defaults

* case classes (and switches thereon)

* tuples

* combinators

* XML interpolation

* Mixins

* Fine-grained visibility

Caveat: I'm no Scala expert. Some of this may be in the libraries and not the language proper.

Now... what Java functionality can you name that's not in Scala?




Not that this diminishes your point, but many of these features (e.g. case classes and pattern matching, list comprehensions) actually make real-world code less complex.

You're right that every bit of complexity Java has also trickles into Scala. For example, Java's broken generics certainly add undesired complexity (type erasure, wonky types) to Scala. Still, I think that idiomatic Scala generally is less complex per unit functionality delivered. It's true that "full Scala" must be more complex than Java because it contains Java as a subset, but I think that more can be accomplished in Scala without making code complex or verbose to the point that it becomes a problem.

In other words, to do comparable things requires far less complexity in Scala than in Java, because Scala delivers the best bang-for-buck by picking the most efficient abstractions. For example, Java concurrency requires a JVM expert to get it right (did you know that doubles and longs aren't thread-safe?) whereas Scala concurrency just requires someone who has a basic understanding of the Actor model.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: