Programming Paradigms (PP)
|Academic Year:||2017/18, 2nd semester||Timetable:||here|
|Lecturer:||Johann Gamper||Lab instructor:||Marco Montali, Thomas Tschager|
FR 08:30-10:30, room E2.21
FR 14:00-16:00: Ex A (Marco Montali)
FR 14:00-16:00, Ex B (Thomas Tschager)
|Office hours:||TU 14:00-15:00 or email arrangement||Lab office hours:|
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.
PrerequisitesStudents 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.
- Overview of programming paradigms
- Imperative paradigm
- Functional paradigm
- Logic paradigm
- Concurrent Programming
- Functional Programming
- Know and understand the basic concepts of different programming paradigms and languages.
- Be able to develop small and medium size programs using different programming languages and paradigms.
- Be able to evaluate strengths and weaknesses of different programming languages in specific application contexts.
- Have developed learning capabilities to pursue further studies with a high degree of autonomy.
- Bruce A. Tate: Seven Languages in Seven Weeks Pragmatic Bookshelf, 2010 (recommended!)
- Maurizio Gabrielli, Simone Martini: Programming Languages: Principles and Paradigms Springer, 2010 (optional)
- Allen B. Tucker, Robert E. Noonan: Programming Languages - Principles and Paradigms (2nd ed.) McGraw-Hill, 2007 (optional)
More details are in the course presentation form.
Timetable and Course Material (year 2016/17)
|1.||Lect||TU 02.03.2018||Introduction and motivation, programming languages and HCI, programming paradigms, basic elements of programming languages, compiled vs. interpreted, syntax, semantics, data types|
|2.||Lect||TU 06.03.2018||Imperative programming, procedural programming, history of imperative programming, abstract data types, information hiding, object-oriented paradigm, objects and classes, messages, inheritance, generics|
|FR 09.03.2018||Ruby: basic concepts, interpreter, strings, control structures, conditionals, loops, (duck) typing, arrays, hashes, symbols||pdf, Ruby web page|
|3.||Lect||TU 13.03.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|
|Lab||FR 16.03.2018||Ruby exercises||instructions, exercises
Ruby Homework (deadline: 04.04.2018; responsible TA: Thomas Tschager)
|4.||Lect||TU 20.03.2018||Basics of recursion, tail recursion, efficiency of recursive functions, writing recursive programs, base case, recursive cases, termination|
|5.||No labs and exercises this week|
|6.||Lect||TU 03.04.2018||Prolog: logic programming paradigm, basics of Prolog, facts, rules, query processing, goals, atoms, predicates, variables, instantiation, backtracking||pdf, Prolog web page|
|TU 06.04.2018||Prolog: box model, debugging, spy points, trace|
|Lab||FR 06.04.2018||Prolog exercises: knowledge bases, facts, predicates|
|7.||Lect||TU 10.04.2018||Prolog: structures, matching structures, equality, comparison operators, arithmetics, lists, splitting lists, enumerating lists, examples (binary search tree, Towers of Hanoi, Sudoku)|
|FR 13.04.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|
|Lab||FR 13.04.2018||Prolog exercises: arithmetics, lists, sorting|
|8.||Lect||TU 17.04.2018||Prolog: interactive programs, sorting, insertion sort, mapping lists and structures|
|FR 20.04.2018||Haskell: introduction, basic concepts, basic functions, conditionals, lists, ranges, list comprehension, basics of the type system, modules||pdf, Haskell web page|
|Lab||FR 20.04.2018||(Only Ex B, Thomas Tschager) Prolog exercises: path finding, accumulators, more sorting|
|9.||Lect||TU 24.04.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|
|FR 27.04.2018||Haskell: input and output, IO actions, execution of IO actions, file IO, handling errors, MayBe type class|
|Lab||MO 23.04.2018, 16:00-18:00||(Only Ex A, Marco Montali) Prolog exercises: path finding, accumulators, more sorting|
|10.||Lab||TH 04.05.2018||Haskell exercises: minimum common divisor, lists|
|11.||Lect||FR 08.05.2018||Haskell: functors, applicative functors, pure and impure values, monads, sequenced actions, do notation, mathematical foundation of Haskell|
|FR 11.05.2018||Erlang: concurrent programming, serial vs. parallel programming, process communication, basic concepts, data types, atoms, variables, pattern matching, lists, tuples||pdf, Erlang web page|
|Lab||FR 11.05.2018||Haskell exercises: inner product, sieve of Eratosthenes, sorting|
|12.||Lect||TU 14.05.2018||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|
|FR 18.05.2018||Erlang: processes, creating processes, sending messages, synchronous messaging, asynchronous messaging, realiablity, process links, exception handling, monitoring processes, managing subsystems of processes|
|13.||Lect||TU 23.05.2018||Summarization of most important concepts, old exams|
|Lab||FR 25.05.2018||Haskell exercises: operator tree, executables and command-line arguments|
|14.||Lab||FR 01.06.2018||Erlang Exercises: sign, string, lists, tuples, simple processes|
|15.||Lab||FR 08.06.2018||Erlang exercises: client-server processes|
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.
The assessment of the course consists of a single written exam at the end that covers the whole course:
- 80% of the exam is to write small programs in each of the programming languages covered in the course;
- 20% are questions about basic concepts.
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.
- 20.09.2017 22.06.2017 31.01.2017
- 21.09.2016 06.07.2016
- 14.09.2015 (6CP), 14.09.2015 (4CP), 06.07.2015 (6CP), 06.07.2015 (4CP)
- 02.02.2015, 26.09.2014, 17.06.2014