Scala: An experience report

Preview:

DESCRIPTION

An experience report after using scala for 6 months.

Citation preview

Scala Experience Report

Mark Needham and Liz Douglass

Funny image?

Funny image?

GAME

ON!

Should the project have been done in

Java?

Does it really speed up the development as was hoped?

What features of the language and patterns of usage have been successes?

Is it easier to maintain and extend than an equivalent Java code base?

Testing

Templating

Domain

Testing

scalatest

specs2

JUnit

scalacheck

Unit testing

Functional Testing

Test DSL

First class functions

Test DSL

# of unit tests:449

# of functional tests:353

# of integration tests:280

Unit testing

Unit testing

BookTests

ArticleTests

ChapterTests

Unit testing

Templating

Scalatra

Scalatra Scalate

Scalatra Scalate

Mustache

scaml

jade

SSP

Controller

Mustache

Jade

View Helper

Jade

Domain

Presentation Model

XML

More XML

More XML

And not just XML…

Going too far!

Traits

Which example was this supposed to be?ContentRepository - JUNE

1. Utilities

Traits

http://blog.schauderhaft.de/2011/08/21/usage-patterns-of-scala-traits/

2. Presentation Model

Traits

3. Helpers to Helpers

Traits

4. Wanna be objects

Traits

5. Type container

Traits

6. Traits with standards

Traits

Implicits

Implicits

Implicits

Options

Refactoring

IDE support

Code discoverability

Method visibility

Less code to

change

Tendency to have fewer

tests

In Retrospect …

Should the project have been done in

Java?

Does it really speed up the development as was hoped?

What features of the language and patterns of usage have been successes?

Is it easier to maintain and extend than an equivalent Java code base?

Greater potential to

high talented

developers

Increased

developer

productivity

Built in XML support

Seamless

integration with

Java + eco-

system

Comes with SBT

– powerful built

tool

Gentle learning curve for Java developers

Runs on the

JVM

Bigger potential to screw things up

Tool support

less matureCommunity is younger and smaller

Scala compiler slower than

Java’s

Easy to learn

Functional

language

Concise code

SBT power

XML support

Case classesJava integration

IDE support

Slow compiler

Complex code

SBT complexity

Immature frameworks

Questions

Recommended