9

Click here to load reader

Teaching Functional Programming @ TCD - 11/2012

Embed Size (px)

DESCRIPTION

Teaching a Scala Module in TCD

Citation preview

Page 1: Teaching Functional Programming @ TCD - 11/2012

FP @ TCD

Scala Module

[email protected]@cs.tcd.ie

Nov 2012

Page 2: Teaching Functional Programming @ TCD - 11/2012

What are we going to do?

● Lecture (90 mins)○ Introduction to Scala

● Lab1 - Rewriting Java○ Josephus problem

● Lab2 - Integrating with Java○ Josephus problem using Apache commons

Page 3: Teaching Functional Programming @ TCD - 11/2012

Why are we doing this?

● Functional programming is on the rise○ Immutable data and side-effect free functions make

development and maintenance of large, complex SW development projects more manageable

● Haskell is a very good way to learn FP○ Green field, good concepts, clean, ...

● Right now in the industry Scala is the language of choice to move teams and larger chunks of source code towards FP○ Scala allows phased adoption (rewrite, refactor, rethink)○ Scala integrates well with existing Java code

Page 4: Teaching Functional Programming @ TCD - 11/2012

Why are we doing this?

Page 5: Teaching Functional Programming @ TCD - 11/2012

Why are we doing this?

Source: http://www.indeed.com/jobtrends

Page 6: Teaching Functional Programming @ TCD - 11/2012

Tools

● Git - Source code management

● SBT - Build tool/environment

● Scala - Repl, compiler, ...

● ScalaTest - TDD, BDD, ...

● IDE - Edit, debug, ... (IntelliJ, Eclipse, Emacs)

Page 7: Teaching Functional Programming @ TCD - 11/2012

Objectives

● Kickstart you on Scala ...○ ... so that you can continue on your own (if you want)

● Focus on the language and the dev env ...○ ... not on FP concepts (you can get these from the

rest of the course)● Work with a minimal, but complete tool suite

Page 8: Teaching Functional Programming @ TCD - 11/2012

Resources

● Learn - Scala Home Page○ http://www.scala-lang.org/○ Downloads, documentation, books, ...○ Read Martin's book

● Learn - Coursera Prog Func 2012○ https://class.coursera.org/progfun-2012-001

● Play - Scala Puzzles○ http://scalapuzzles.org

● Play - 99 Scala Problems○ http://aperiodic.net/phil/scala/s-99/

Page 9: Teaching Functional Programming @ TCD - 11/2012

Ready?