- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Java to Scala with the Help of Experts
Created by bagwell on 2009-02-24.
Updated: 2011-01-07, 15:55
You will find some introductory material but mostly more advanced material written by the research team of EPFL here.
An easy way to get started with Scala is by using the Scala interpreter, which is an interactive “shell” for writing Scala expressions and programs. Simply type an expression into the interpreter and it will evaluate the expression and print the resulting value. The interactive shell for Scala is simply called scala. You use it like this: Scala for Java Refugees
Java to Scala with the Help of Experts
Many leading experts in the industry have recognised the importance of Scala and are enthusiastic to help others appreciate the language. They have written excellent reviews and teaching materials that range from broad evaluations of the language to detailed cook-books on how to use the scala language. Each one comes from a different programming background and quite likely you will find one like your own. At times we all get stuck on learning a specific topic, just don't seem to get it. We need to take a look from a fresh point of view to gain the insight we need. Here are some people who can help you do just that.
There are lots of other experts in the Scala community and Scala user groups that are there ready to help you too. For example, there is a community web site for Scala, the Scala Wiki, where you will find information and advice from many other programmers. There you will find programming tips and links to other useful sites.
There is a growing list of books on programming in Scala too.
If you find other material helpful as you moved from Java to Scala or from other languages please let us know so we can share it with other first time Scala programmers. Now some experts:-
If you find other material helpful as you moved from Java to Scala or from other languages please let us know so we can share it with other first time Scala programmers. Now some experts:-
EPFL
You will find some introductory material but mostly more advanced material written by the research team of EPFL here.
Dean Wampler (Object Mentor) Aspect Research Associates
Dean Wampler gives a practical introduction to the Scala programming language from the view of an experienced programmer moving from Java to Scala. You will find an excellent summary of the main capabilities of the language in his series “The Seductions of Scala”. The series is in three parts and he introduces in the following way:-
“I decided to learn Scala … because it is a JVM language that combines object-oriented and functional programming in one language. At ~13 years of age, Java is a bit dated. Scala has the potential of replacing Java as the principle language of the JVM, an extraordinary piece of engineering that is arguably now more valuable than the language itself.”
He presents key concepts clearly and then gives examples of the typical code you may write. You will find it a fun way to get started on Scala.
The Seductions of Scala
- Part 1 Introduction to Language Features
- Part 2 Functional Programming
- Part 3 Concurrent Programming
Bill Venners Artima
Is President of Artima and one of the co-athors of the "Programming Scala" book. He is a respected expert on the topic of Java and Scala.
In “First Steps to Scala” you will be shown how you can quickly use the Scala interpreter to try out small scala programs. If you are familiar with Java it is an excellent place to start. If you are already a frequent user of one of the Java IDEs (e.g. Eclipse, NetBeans or Intellij) then you may prefer to use the development tools here.
This is how Bill introduces gets you started with the interpreter:
An easy way to get started with Scala is by using the Scala interpreter, which is an interactive “shell” for writing Scala expressions and programs. Simply type an expression into the interpreter and it will evaluate the expression and print the resulting value. The interactive shell for Scala is simply called scala. You use it like this:
$ scala This is an interpreter for Scala. Type in expressions to have them evaluated. Type :help for more information. scala> After you type an expression, such as 1 + 2, and hit return: scala> 1 + 2 The interpreter will print: unnamed0: Int = 3
You will find the complete article, First Steps to Scala, here.
Daniel Spiewak
Is an experienced software developer who has worked with Java, Ruby, Scala, SQL, C, C++, ML, and other languages.
Scala for Java Refugees
In this series of articles Daniel Spiewak takes a Java programmer through a carefully thought out tour of the Scala language. The journey takes you through first steps to writing sophisticated programs. Then you are taken into the fun and rewarding parts of the Scala language. The tour finishes with a thorough exploration of the unrivalled interoperability of Scala and Java. You see how to leverage existing Java libraries and switch smoothly between Java and Scala in your applications.
Some aspects have changed in the year since his first articles appeared. Tools like, Eclipse for example, have undergone major revision work adding features and stability. Frameworks such as Lift have appeared on the scene to provide significant productivity gains.
- Part 1: main(String[]) – Getting started
- Part 2: Basic OOP - Syntax and Import
- Part 3: Methods and Statics – Concepts and Singleton
- Part 4: Pattern Matching and Exceptions – A post that draws lots of interest from readers
- Part 5: Traits and Types – Alternatives to interfaces.
- Part 6: Getting Over Java – The fun parts of Scala
- Part 7: Interop Between Java and Scala – The simplicity of interoperability.
Ted Neward Neward & Associates
Ted Neward is the principal of Neward & Associates, where he consults, mentors, teaches, and presents on Java, Scala, .NET, XML Services, and other platforms.(ted [at] tedneward [dot] com),
In his series of articles on IBM.com, “The busy Java developer’s guide to Scala”, Ted Neward shows you why he has moved on from Java, his first love, to Scala. In this series of articles he compares the traditional Java code style with what he now finds the much more concise and expressive Scala language.
What you will enjoy is the way he shows examples of everyday Java code alongside their equivalent in Scala. He will take you all the way from first steps to the hot problems of concurrency. Following him you too will see why he has found a new soul-mate in Scala.
The busy Java developer’s guide to Scala
- Part 1 Functional programming for the object oriented
- Part 2 Class action
- Part 3 Don’t get thrown for a loop
- Part 4 Of traits and behaviors
- Part 5 Dead like COBOL
- Part 6 Implementation inheritance
- Part 7 Collection types
- Part 8 Packages and access modifiers
- Part 9 Building a calculator, Part 1
- Part 10 Building a calculator, Part 2
- Part 11 Building a calculator, Part 3
- Part 12 Scala and servlets
- Part 13 Explore Scala concurrency
- Part 14 Dive deeper into Scala concurrency
- Part 15 Scala + Twitter = Scitter
- Part 16 Enhancing the Scitter library
Mario Gleichmann blog Brain Driven Development
Mario gives a systematic introduction to the Scala programming language for beginners who have some programming experience. You will find a good tour of the basic language features with emphasis on the functional programming style. There are seven articles in the series.
Functional Scala
- Part 1 Introduction
- Part 2 Functions
- Part 3 Functions as objects as functions
- Part 4 Closures
- Part 5 Comprehending comprehensions
- Part 6 Higher order functions
- Part 7 Functional Scala lambdas and other shortcuts
A. Sundararajan Weblog
Here you will find a very useful reference for Java programmers moving to Scala. He provides a very practical mapping from Java language structures to Scala ones. In his own words it provides a “Head-Start” for anyone making the transition. As you know it normally takes a little while to become fluent in the syntax of a new language. This handy list of mappings provides a quick way to remind you of the specific syntax for equivalent language features in Java and Scala.
You will find the mapping table here.
Joakim Ohlrogge
In a series of posts Joakim, a Scala programmer in Sweden, shares his experiences, both the frustrating ones and the joys of discovering Scala. In the process he gives many tips and examples that are valuable to anyone learning Scala.
Phasing over from Java to Scala, his experience.
- Part 1 Convert pet project to Scala
- Part 2 Buildr
- Part 3 What about tests?
- Part 4 Writing Specs with specs
- Part 5 A retrospective view
In his posts Joakim also provides tips for using the Scala “nuggets”:
- Post 1 Making SWT shine with Scala
- Post 2 Pattern Matching and Lists
- Post 3 Drying up widget creation
- Post 4 Implicits make Java blend into Scala
Dave Orme
Builds on the work of Joakim to 'radically' simplify the use of SWT. In the last step of this transformation he introduces a new domain-specific language (DSL) written in Scala called XScalaWT, which is a successor to the XML-based XSWT project.
James Iry
James Iry provides a lighthearted yet provocative context to think about some advanced topics and the deeper parts
of Scala.
- The Kingdom of Nerbs: Discusses the relationship between objects and functions.
- Martians vs Monads: Null Considered Harmful: Compares Java’s null with Scala’s Option type.
Monads are Elephants (An introduction to monads in Scala.)