Programming Paradigms (PP)
|Academic Year:||2016/17, 2nd semester|
|Lecturer:||Johann Gamper||Lab instructor:||Theodoros Chondrogiannis|
TH 08:30-10:30, room E221
TH 14:00-16:00, Ex B
FR 10:30-12:30, Ex A
|Office hours:||TU 11:00-12:00 or email arrangement||Lab office hours:||TH 17:00-18:00, POS 2.12 or email arrangement (email@example.com)|
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.
|1.||TU 28.02.2017||Introduction and motivation, programming languages and HCI, programming paradigms, basic elements of programming languages, compiled vs. interpreted, syntax, semantics, data types|
|TH 02.03.2017||Imperative programming, procedural programming, history of imperative programming, abstract data types, information hiding, object-oriented paradigm, objects and classes, messages, inheritance, generics|
|No exercises this week|
|2.||TU 07.03.2017||Ruby: basic concepts, interpreter, strings, control structures, conditionals, loops, (duck) typing, arrays, hashes, symbols||Ruby HW
|Ruby web page|
|TH 09.03.2017||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|
|TH 09.03.2017||Ruby exercise: arrays, files, classes, modules, mixins||instructions
|3.||TU 14.03.2017||Basic idea of recursion, tail recursion, efficiency of recursive functions, writing recursive programs, base case, recursive cases, termination||Prolog HW
|Prolog web page|
|TH 16.03.2017||Prolog: logic programming paradigm, basics of Prolog, facts, rules, query processing, goals, atoms, predicates, variables, instantiation, backtracking|
|TH 16.03.2017||Prolog exercise: knowledge bases, facts, predicates.||instructions
|4.||No lectures or exercises this week|
|5.||TU 28.03.2017||Prolog: box model, debugging, spy points, trace|
|TH 30.03.2017||Prolog: structures, matching structures, equality, comparison operators, arithmetics, lists, splitting lists, enumerating lists, examples (binary search tree, Towers of Hanoi, Sudoku)|
|TH 30.03.2017||Prolog exercise: arithmetics, lists. sorting.||exercises
|6.||TU 04.04.2017||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|
|TH 06.04.2017||Prolog: interactive programs, sorting, insertion sort, mapping lists and structures|
|TH 06.04.2017||Prolog exercise: path finding, accumulators, more sorting||exercises
|7.||TU 11.04.2017||Haskell: introduction, basic concepts, basic functions, conditionals, lists, ranges, list comprehension, basics of the type system, modules||Haskell HW
|Haskell web page|
|TH 13.04.2017||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|
|No exercises this week|
|8.||TU 18.04.2017||Haskell: input and output, IO actions, execution of IO actions, file IO, handling errors, MayBe type class|
|TH 20.04.2017||Haskell: functors, applicative functors, pure and impure values, monads, sequenced actions, do notation, mathematical foundation of Haskell|
|TH 20.04.2017||Haskell exercise: minimum common divisor, lists||instructions
|9.||No lectures or exercises this week|
|10.||TU 02.05.2017||No lectures this week|
|TH 04.05.2017||Haskell exercise: inner product, sieve of Eratosthenes, sorting||exercises
|11.||TU 09.05.2017||Erlang: concurrent programming, serial vs. parallel programming, process communication, basic concepts, data types, atoms, variables, pattern matching, lists, tuples||Erlang HW
|Erlang web page|
|TH 11.05.2017||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|
|TH 11.05.2017||Haskell exercise: operator tree, executables and command-line arguments||exercises
|12.||TU 16.05.2017||Erlang: basic concepts of processes, creating processes, sending messages, synchronous messaging, asynchronous messaging, realiablity, process links, exception handling, monitoring processes, managing subsystems of processes|
|TH 18.05.2017||Summarization of most important concepts, old exams|
|TH 18.05.2017||Erlang Exercise: sign, string, lists, tuples, simple processes||instructions
|13.||No lectures this week|
|TH 25.05.2017||Erlang exercise: client-server processes||exercises
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.
- 22.06.2017 (6CP) 31.01.2017 (6CP)
- 21.09.2016 (6CP) 06.07.2016 (6CP)
- 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