Scala Koans

Java & JVM
Location: D137-138 Level: Novice
Presentation: Scala Koans Presentation [PDF]
Average rating: **...
(2.56, 9 ratings)

Attendee prerequisites for this tutorial are listed below.

Koans are small Zen lessons, Scala Koans are small Zen lessons — in Scala! Koans as little exercises are designed to provide tidbits of knowledge that when bundled together provide an in-depth understanding, Each Koan comes complete with their own little epiphanies of joy. Scala Koans have been a favorite for developers helping them make their path to Scala Nirvana.

Scala Koans have been presented at various conferences around the country, by Dianne Marsh and myself to help people learn and understand Scala. Each Scala Koan is simple with a small lesson, which is done for the purpose of focus and clarity.

An example of a Scala Koan looks like the following:

koan(“For loops can be simple”) {
val someNumbers = Range(0, 10)
var sum = 0
for (i <- someNumbers)
sum += i

sum should equal(__)

Each Koan has a __ where they fill in the answer, and it is encouraged that when successfully passing a Koan to reflect on koan and how it worked. They are encouraged to raise any question about the Koan at any time.

When many developers have the same question about a Koan, an organic and spontaneous discussion or presentation is started to offer more insight into that lesson of the language.

Koans have been greatly received from developers across the country.

Please download and install JDK 1.6+ from

QUESTIONS for the speaker?: Use the “Leave a Comment or Question” section at the bottom to address them.

Photo of Daniel Hinojosa

Daniel Hinojosa

Daniel Hinojosa has been a self-employed developer, teacher and speaker for private business, education, and government since 1999. He also currently teaches programming at the University of New Mexico Continuing Education. His business is revolved around the Java ecosystem, encompassing multiple languages and frameworks. Daniel is a Pomodoro Technique practitioner and is co-founder of the Albuquerque Java User’s Group in Albuquerque, New Mexico.

Photo of Dianne Marsh

Dianne Marsh


Dianne Marsh, co-founder of SRT Solutions, has deeply rooted expertise in software programming and technology, including manufacturing, genomics decision support and real-time processing applications. Dianne works with Unix, Windows, Java, C#, and C++ in enterprise-level applications, and has deep experience with a variety of graphical user interface libraries. A member of Women Presidents Organization, Dianne is also active in CodeMash and various Java user groups. She earned her Master of Science degree in computer science from Michigan Technological University.

Comments on this page are now closed.


Picture of Dianne Marsh
Dianne Marsh
07/22/2012 11:55pm PDT

That’s good feedback, Bert. The koans were intended to be a tutorial on how to use the language. We didn’t consider adding in a component to motivate its use (the “why to learn Scala part”). I do think that showing the advantage of a case class over a regular class or match expressions over if statements would be good additions to the koans. Thanks!

Picture of Bert Porter
Bert Porter
07/22/2012 6:36am PDT

I like the overall concept of the KoanSuite, but I found it to be pretty limited as a learning tool. I needed some interpretation, explanation of motivation, etc. Why would someone want to learn and use Scala? What is the benefit of, for instance, a case class? etc.


For information on exhibition and sponsorship opportunities at the conference, contact Sharon Cordesse at (707) 827-7065 or

View a complete list of OSCON contacts