I'm interested in learning Scala. I've been reading a lot about it, but a lot of people value it because it has an actor model which is better for concurrency, it handles xml in a much better way, solves the problem of first class functions.

My question is do you need to know Java to understand/appreciate the way things work in Scala? Is it better to first take a stab at Java and then try Scala or you can start Scala with absolutely no java backround?

  • 5
    Do you need to a biface in order to appreciate how saws work? :D
    – back2dos
    Nov 21 '11 at 11:14
  • lol, I would upvote this answer.
    – gizgok
    Nov 21 '11 at 12:02

Scala is its own language, and by itself doesn't require knowledge of any existing languages. If you wanted to, you could learn Scala as your first language. On the Learning Scala page of their website, there are entry points to the tutorial for different levels of experience, ranging from first-time programmers to programming language researchers to functional programming experts.

Most of the documentation is focused on people who know how to program, unfortunately, but I've actually worked through some of the Scala tutorials. It's not that bad. It's expected that you understand certain basic concepts, though.

  • 4
    Thomas is completely correct. I only want to add that part of the appeal of Scala is that you can reuse the entire honking big standard library of Java. That may or may not be important in your case, but if it is, then previous experience with Java will obviously be very helpful, because you can't help having learnt a lot about the standard library. Nov 21 '11 at 11:56
  • @Kilian I thought about that. I'm still learning Scala and haven't actually done anything meaningful with it yet, but I'm not sure how important it is to know Java to be able to use a Java library in Scala. It's not like you drop into Java syntax/style to call a precompiled JAR from Scala.
    – Thomas Owens
    Nov 21 '11 at 11:58
  • 2
    For just about every modern platform it takes a lot longer to learn the standard library than to learn the language syntax. So there is a benefit in knowing Java libraries if you are trying to learn Scala.
    – Jeremy
    Nov 21 '11 at 17:11

Java means two different things:

  1. the Java language - this includes the language, with its syntax, rules, features and overall semantics
  2. the Java platform - this includes the runtime (JVM), the whole standard library and a number of popular frameworks/libraries. Note there are also other Java "runtimes" such as being executed as JavaScript after crosscompilation through GWT, or Java on Android, which is also runs in a different runtime

The Java language and Scala both run on the same platform. AFAIK Scala can call down to Java code quite easily, so if there is any real interest in learning Java to understand/leverage Scala, then it is to understand how this works and how you can best use Java code from within a Scala app. As a language, Java is unlikely to teach you anything C# wouldn't have taught you by now (I assumed from your profile you have some C# experience).

This question's .NET-analogy would be:

Do you need to know C# / VB.NET before trying F#?

In either case, the answer is a pretty firm "No."


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.