Official course description:
This course addresses advanced programming techniques, with a special attention on functional programming and its applications. The course is a perfect balance of theory and practice, with focus on the Scala programming language.
The student who passes this course will know relevant advanced programming techniques for designing, testing and executing challenging realistic programs in Scala, in a correct and efficient way. Such techniques, although learned in the Scala programming language, are relevant for many other mainstream programming languages used in industry.
- Introduction to Scala
- Property-based testing
- Monads and streams
- Call-by-name and lazy programming
- Immutable data-structures
- Purely functional parallel programming
- Examples of purely functional data structures and
- Functional probabilistic programming
- The main prerequisite that Advanced Programming builds on is the basic functional programming including higher-order functions, anonymous functions (or lambdas, delegates or anonymous inner classes), side-effect-free programming, generic types, and methods. This can be obtained by following the course Functional Programming on SWU or SD.
Note for SD students: It is important that SD students have taken the course Functional Programming before entering Advanced Programming.
The following, somewhat less critical, competences can be obtained by following an introductory programming course, an introductory algorithms course and a course on programming languages ('Programmer som Data' or 'Programming Language Concepts and Implementation' or equivalent.)
- You should also be able to program in Java (You will survive the course if you can program well in C# or any other main stream object-oriented language, but your experience may be steeper)
- You should know basic algorithms and data structures (sorting,
searching, collection data structures and basics of
- You should know basic discrete mathematics (sets, functions, relations)
- You have followed an introductory course on programming
Intended learning outcomes
After the course, the student should be able to:
- Design, test and execute functional programs in Scala
- Use expressive types (polymorphism, type functions, higher-kinded types) to document library interfaces
- Recognize monadic structures in computation, use libraries following monadic structure and design monadic libraries
- Reason about eager and lazy evaluation, including advantages and disadvantages of either
- Reason about API designs in pure and stateful style, including exploring various designs and considering advantages and disadvantages of either
- Use eager and lazy evaluation to design data structures and benefit from existing lazy data structures such as streams
- Implement solutions based on research-based methods presented in relevant papers in library and language design
- Design and implement solutions using lenses, reason about lenses
We organize weekly lectures and exercises, as well as some warm-up pre-course activities, and extra homework help (ADPRO Cafe).
In the exercises (and the associated homework exercises) you learn to test and design functional programs in Scala, with a particular emphasis on API and library design.
The lectures provide an overarching reflection over the patterns and techniques used, as well as they prepare you for solving the exercises.
Most time is spent on small practical exercises and projects, resembling the exam questions. Training building solutions based on research happens by reading research papers and implementing programs based on them. We use the study of the paper on Lenses to experience mathematical modeling and formal reasoning about practical programming tasks.
You have to complete and pass 5 out of 10 home works in order to be admitted to the exam. Home-works are handed-in in two-person groups.
The handins must show a genuine and original effort towards solving the problems, but handing in incomplete solutions is permitted. The code handed in must compile (we reserve the right to fail solutions that do not compile). If you cannot complete some code, comment out the parts that make the compiler fail.
Handing in solutions prepared by other groups is not acceptable, and will be reported to the university.
Homework assignments are published approximately weekly. If you missed a deadline for a handin, or failed it, you have a second chance a week later, after the original deadline.
The student will receive the grade NA (not approved) at the ordinary exam, if the mandatory activities are not approved and the student will use an exam attempt.
Paul Chiusano. Runar Bjarnason. Functional Programming in Scala. Manning 2014
Student Activity BudgetEstimated distribution of learning activities for the typical student
- Preparation for lectures and exercises: 20%
- Lectures: 10%
- Exercises: 10%
- Assignments: 50%
- Exam with preparation: 10%
Ordinary examExam type:
C: Submission of written work, External (7-point scale)
C22: Submission of written work – Take home
C22: Submission of written work 4 hrs. Random fraud control for 20 %.
All aids allowed, but no communication and collaboration allowed.
B: Oral exam, External (7-point scale)
B1I: Oral exam with time for preparation. In-house.