High-Level Abstraction Programming

Data is displayed for academic year: 2023./2024.

Course Description

Methods as first class objects. Lazy evaluation. Iterables and iterators. Composition of iterators. Creating iterables and collections with comprehensions. Manipulating iterators. Side-effects and pure functions. Argument packing and unpacking. Decorating functions. Lambda expressions. Closures. Decorators and memoization. Generators and generator functions. Classes as first-class objects. Properties and descriptors. Metaclasses.

Study Programmes

University graduate
[FER3-HR] Audio Technologies and Electroacoustics - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Communication and Space Technologies - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Computational Modelling in Engineering - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Computer Engineering - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Computer Science - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Control Systems and Robotics - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Data Science - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Electrical Power Engineering - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Electric Machines, Drives and Automation - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Electronic and Computer Engineering - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Electronics - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Information and Communication Engineering - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Network Science - profile
Elective Courses (1. semester) (3. semester)
[FER3-HR] Software Engineering and Information Systems - profile
Elective Courses (1. semester) (3. semester)

Learning Outcomes

  1. discuss advantages of implicit polymorphism in dynamic languages
  2. apply methods as first-class objects
  3. explain advantages of lazy evaluation
  4. explain elements of the iterator protocol
  5. apply function decorators for lazy evaluation
  6. evaluate advantages of generators in comparison with classic programming techniques

Forms of Teaching

Lectures

Lectures will be held two hours per week.

Independent assignments

Individual assignments will be solved as a preparation and within the laboratory exercises.

Laboratory

Laboratory exercises will be held in four blocks of 2 hours.

Grading Method

Continuous Assessment Exam
Type Threshold Percent of Grade Threshold Percent of Grade
Laboratory Exercises 50 % 20 % 50 % 20 %
Mid Term Exam: Written 0 % 35 % 0 %
Final Exam: Written 30 % 45 %
Exam: Written 50 % 80 %

Week by Week Schedule

  1. Definition of classes: fields, methods, and constructors, Subclasses, inheritance, and method overriding, Module systems
  2. Dynamic dispatch: definition of method-call, Subtyping
  3. Classes, methods and functions as first-class objects
  4. Using collection classes, iterators, and other common library components
  5. Nested and inner classes and functions; Closures
  6. Side effects and state-less computation. Lazy evaluation and infinite streams
  7. Higher-order functions (taking and returning functions)
  8. Midterm exam
  9. Nested and inner classes and functions; Closures, Function closures (functions using variables in the enclosing lexical environment, canonical idioms, currying, partial application)
  10. Functional idioms (map, reduce/fold, filter)
  11. Lazy evaluation and infinite streams
  12. Lazy evaluation, infinite structures, strictness, Control abstractions (exception handling, continuations, monads)
  13. Defensive programming (e.g. secure coding, exception handling)
  14. Metaprogramming (macros, generative programming, model-based development)
  15. Final exam

Literature

Zoran Kalafatić, Antonio Pošćić, Siniša Šegvić, Julijan Šribar (2016.), Python za znatiželjne, Element
Luciano Ramalho (2021.), Fluent Python, O'Reilly Media

For students

General

ID 222725
  Winter semester
5 ECTS
L1 English Level
L1 e-Learning
30 Lectures
0 Seminar
0 Exercises
8 Laboratory exercises
0 Project laboratory
0 Physical education excercises

Grading System

88 Excellent
75 Very Good
62 Good
50 Sufficient