Overview
Creative Scala is aimed at developers who have no prior experience in Scala. It is designed to give you a fun introduction to functional programming. We assume you have some familiarity with another programming language but little or no experience with Scala or other functional languages.
Our goal is to demonstrate the building blocks that Scala developers use to create programs in a clear, succinct, and declarative manner. Working through the exercises in the book should take a few hours, after which you will know the basics of programming in Scala and have a feel of how the functional programming mindset works.
The exercises in Creative Scala are based on a functional graphics library called Doodle. Although Doodle is primarily designed to make programming fun and creative, it is based on universal concepts that apply to all well-designed software written in a functional style.
Prerequisites
One to two years’ experience with a programming language. No prior experience with Scala or functional programming is required.
Learning Outcomes
In just a few hours, this course give you the basic mental model required to become competent with Scala, However, by the time you finish you won’t finish knowing everything you need to be self-sufficient. We recommend Essential Scala to continue your journey learning Scala.
Table of Contents
-
Foreword
- Expressions, Values, and Types
- Simple Scala Expressions
- Literals
- Method Calls
- Constructor Calls
- Operators
- Conditionals
- Blocks and Side-Effects
- Working with Doodle
- Primitive Images
- Layout
- Colour
- Take Home Points
- Substitution
- Types in Scala
- Simple Scala Expressions
- Declarations
- Value Declarations
- Method Declarations
- Extended Exercise: Colour Palettes
- Take Home Points
- (Functional) Programming
- Recursive Algorithms
- Functions as Values
- Higher Order Methods and Functions
- Take Home Points
- Collections
- Creating Lists
- Transforming Lists Using map
- Take Home Points
-
Summary
-
Appendix: Syntax Quick Reference
- Appendix: Solutions to Exercises