Official course description:

Full info last published 29/11-23
Course info
Language:
English
ECTS points:
7.5
Course code:
KSADPRO2KU
Participants max:
128
Offered to guest students:
yes
Offered to exchange students:
yes
Offered as a single subject:
yes
Price for EU/EEA citizens (Single Subject):
10625 DKK
Programme
Level:
MSc. Master
Programme:
MSc in Computer Science
Staff
Course manager
Full Professor
Teacher
Part-time Lecturer
Teacher
PhD student
Teacher
PhD student
Course semester
Semester
Efterår 2023
Start
28 August 2023
End
26 January 2024
Exam
Exam type
ordinær
Internal/External
ekstern censur
Grade Scale
7-trinsskala
Exam Language
GB
Abstract

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.

Description

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 3
  • 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 algorithms 
  • Functional probabilistic programming

Formal prerequisites

Important: Advanced Programming builds on 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 Functional Programming on BSWU or KSD. 

You should know basic concepts of programming language theory and implementation (for instance by having followed Programmer som Data or Programming Language Concepts and Implementation)

You should also be able to program in Java (You will survive the course if you can program well in C# or any other mainstream object-oriented language, but your experience may be steeper).

You should know basic discrete mathematics (sets, functions, relations).

You should know basic algorithms and data structures (sorting, searching, collection data structures and basics of algorithms complexity).

Note for SD students: 
It is important that SD students have taken the course Functional Programming before entering Advanced Programming.

Note for new KCS-students:
Upon admission we check that you have some basic knowledge of functional programming; however, if you find that functional programming is a challenge, you should visit StudyLab and the teaching assistants will be happy to assist you.


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
Learning activities

We organize  weekly lectures and exercises.

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 resembling 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.

Mandatory activities

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 by every student individually.

Each assignment consists of a number (ca. 5 to 30) of small programming tasks, most them just a few lines long.

The code handed in must compile as we use automatic grading (partly). Solutions that do not compile will fail. If you cannot complete some code, comment out the parts that make the compiler fail.

For most tasks, we provide immediate automatic feedback in the form of property-based tests. Personal feedback is provided by teaching assistants in class (orally) or in writing (via LearnIT), for students who request it.

Handing in solutions prepared by others is not acceptable, and will be reported to the program administration.

Homework assignments are published approximately weekly. If you missed a deadline for a hand-in, or if 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.

Course literature

Michael Pilquist, Rúnar Bjarnason, and Paul Chiusano. Functional Programming in Scala. 2nd edition. Manning 2022

Student Activity Budget
Estimated 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 exam
Exam type:
A: Written exam on premises, External (7-point scale)
Exam variation:
A11: Written exam on premises. Open book exam.
Exam duration:
4 hours


reexam
Exam type:
B: Oral exam, External (7-point scale)
Exam variation:
B1I: Oral exam with time for preparation. In-house.
Exam duration per student for the preparation:
30 minutes
Invigilator present for the preparation:
Yes
Exam duration per student for the oral exam:
40 minutes

Time and date
Ordinary Exam - on premises Fri, 5 Jan 2024, 09:00 - 13:00
Reexam Wed, 13 Mar 2024, 08:00 - 19:05
Reexam Thu, 14 Mar 2024, 12:00 - 18:00