Programming Paradigms (PP)

Academic Year:2018/19, 1st semester Timetable: here
Lecturer:Johann Gamper Lab instructor:Radityo Eko Prasojo, Thomas Tschager
Schedule:TU 12:00-14:00
TH 10:00-12:00, room C 3.06
Schedule: TH 16:00-18:00: Ex A (Prasojo Radityo Eko)
TH 16:00-18:00, Ex B (Thomas Tschager)
Office hours:Email arrangement Lab office hours:Thomas Tschager: TH 15:00-16:00, POS 1.04 (contact Thomas during the lab or by email); Prasojo Radityo Eko: contact Prasojo during the lab or by email

Objectives

To learn the key concepts and to get a basic understanding of the most popular programming paradigms and languages, including their strengths and weaknesses. To learn to write small programs in different programming languages.

Prerequisites

Students should have a solid mathematical foundation, good programming skills in an imperative or object-oriented language and be familiar with basic data structures and algorithms. These prerequisites are covered in the following courses: Analysis, Introduction to Programming, Programming Project, and Data Structures and Algorithms.

Syllabus

Learning outcomes

Reading List

More details are in the course presentation form.

Timetable and Course Material

Useful links: timetable, course material in OLE, lecture notes 2017/18

Week Type Date Topic Course material
1. No labs and exercises in the first week
2. LECT TU 09.10.2018   Introduction and motivation, programming languages and HCI, programming paradigms, basic elements of programming languages, compiled vs. interpreted, syntax, semantics, data types slides
LECT TH 11.10.2018 Imperative programming, procedural programming, history of imperative programming, abstract data types, information hiding, object-oriented paradigm, objects and classes, messages, inheritance, generics slides
3. No labs and exercises in this week
4. LECT TU 23.10.2018 Ruby: basic concepts, interpreter, strings, control structures, conditionals, loops, (duck) typing, arrays, hashes, symbols slides, Ruby web page
LAB TU 23.10.2018 Ruby exercises Ruby instructions, Ruby exercises 1 (solutions), first ruby
Ruby Homework (deadline: 06.11.2018; responsible TA: Thomas Tschager)
LECT TH 25.10.2018 Ruby: functions, (named) parameters to functions, code blocks, parameters to code blocks, procs, classes, Ruby metamodel, inheritance, modules, mixins, an sample tree class, insertion sort slides
5. LECT TU 30.10.2018 Basics of recursion, tail recursion, efficiency of recursive functions, writing recursive programs, base case, recursive cases, termination slides
LAB TU 30.10.2018 Ruby exercises Ruby exercises 2 (solutions)
6. LECT TU 06.11.2018 Prolog: logic programming paradigm, basics of Prolog, facts, rules, query processing, goals, atoms, predicates, variables, instantiation, backtracking slides, Prolog web page
LAB TU 06.11.2018 Prolog exercises: knowledge bases, facts, predicates instructions, minibase.pl, Prolog exercises 1 (solutions)
Prolog Homework, basegraph.pl (deadline: 04.12.2018)
LECT TH 08.11.2018 Prolog: box model, debugging, spy points, trace slides
7. LECT TU 13.11.2018 Prolog: structures, matching structures, equality, comparison operators, arithmetics, lists, splitting lists, enumerating lists, examples (binary search tree, Towers of Hanoi, Sudoku) slides
LAB TU 13.11.2018 Prolog exercises: arithmetics, lists, sorting Prolog exercises 2 (solutions)
LECT TH 15.11.2018 Prolog: accumulators, lists as accumulators, the order of subgoals, the order of clauses/rules, cut operator, cutting the number of solutions, confirming the choice of a rule, cut-fail combination, generate and test pattern, replace cut by not slides
8. No labs and exercises in this week
9. LECT TU 27.11.2018 Canceled
LAB TU 27.11.2018 Prolog exercises: path finding, accumulators, more sorting Prolog exercises 3 (solutions)
LECT TH 29.11.2018 Prolog: interactive programs, sorting, insertion sort, mapping lists and structures slides
EXCURSION FR 30.11.2018 Excursion to Ivoclar, Naturns Program
10. LECT TU 04.12.2018 Haskell: introduction, basic concepts, basic functions, conditionals, lists, ranges, list comprehension, basics of the type system, modules slides, Haskell web page
LAB TU 04.12.2018 Haskell exercises: minimum common divisor, lists instructions, fac.hs, exercises (solutions)
Haskell Homework, spatial.hs (deadline: 08.01.2019)
LECT TH 06.12.2018 Haskell: functions and pattern matching, lazy evaluation, higher order functions, curried functions, user-defined data types, recursive data types, polymorphism, type classes, user-defined type classes, functors slides
11. LECT TU 11.12.2018 Haskell: input and output, IO actions, execution of IO actions, file IO, handling errors, MayBe type class slides
LAB TU 11.12.2018 Haskell exercises: inner product, sieve of Eratosthenes, sorting exercises (solutions)
LECT TH 13.12.2018 Haskell: functors, applicative functors, pure and impure values, monads, sequenced actions, do notation, mathematical foundation of Haskell slides
12. LECT TU 18.12.2018 Erlang: concurrent programming, serial vs. parallel programming, process communication, basic concepts, data types, atoms, variables, pattern matching, lists, tuples slides, Erlang web page
LAB TU 18.12.2018 Haskell exercises: operator tree, executables and command-line arguments exercises (solutions)
13. LECT TU 08.01.2019 Erlang: modules, functions, local functions, multiple matching possibilities, recursive functions, function evaluation, guards, control structures, anonymous functions, higher-order functions, lists and higher-order functions slides
LAB TU 08.01.2019 Erlang exercises: sign, string, lists, tuples, simple processes instructions, yam.erl, exercises, flights.txt
Erlang Homework, data.txt (deadline: 23.01.2019)
LECT TH 10.01.2019 Erlang: processes, creating processes, sending messages, synchronous messaging, asynchronous messaging, realiablity, process links, exception handling, monitoring processes, managing subsystems of processes slides
14. LECT TU 15.01.2019 Summarization of most important concepts, old exams slides
LAB TU 15.01.2019 Erlang exercises: client-server processes exercises

Homework

You will get 4 assignments during the semester, one for each programming language. If you hand in the homework, it will be graded and considered to improve your final course mark (for details see below). Each homework will be graded with a mark between 18 and 30 c.l.; if you don't hand in an assignment, it counts with a mark of 18. The final grade of your homework will be determined as the average over the four assignments. The homework is optional.

Exam

The assessment of the course consists of a single written exam at the end that covers the whole course:

The first part verifies the ability to solve problems by developing small programs in different programming languages. The second part verifies the understanding of key concepts of different programming paradigms and languages.

If the mark of your homework is greater than the mark of the written exam, the final course exam mark will be computed as the average of the two marks; otherwise, the homework has no impact on the final course mark. Hence, the homework can only increase your final mark.

Previous exams