You are here: Home » Study Plan » Subject

Sciences

Subject: COMPLEMENTI DI PROGRAMMAZIONE (A.A. 2024/2025)

degree course in COMPUTER SCIENCE

Course year 3
CFU 6
Teaching units Unit Complementi di programmazione
Information Technology (lesson)
  • TAF: Compulsory subjects, characteristic of the class SSD: INF/01 CFU: 6
Teachers: Angelo FERRANDO
Exam type oral
Evaluation final vote
Teaching language Italiano
Contents download pdf download

Teachers

Angelo FERRANDO

Overview

The course aims to provide a presentation of the main characteristics of the Python language, with particular regard to the differences with static languages (C, C ++, Java). The teaching goals are multiple:
- to enable the student to fully understand the advantages and disadvantages deriving from the use of languages with strong dynamic characteristics;
- to supplement basic training with additional programming tools useful in different contexts
- to allow the student to gain an in-depth knowledge of the Python language and a consequent advanced ability to its use
- consolidate skills on software development, testing and distribution at a professional level.

Admission requirements

To attend this course proficiently, some programming skills (in general) and object-oriented programming experience (in particular) are required. It is recommended to have passed (or at least attended the lessons of) the Object-oriented Programming, Programming II and Operating Systems courses.

Course contents

This course is scheduled for the first semester of the third year, for a total of 48 hours of frontal teaching which will take place partly in the classroom and partly in the computer lab (unless otherwise prescribed depending on the health situation). The contents reported below must be understood as purely indicative. Many of the topics are intertwined with each other and cannot be treated in full with continuity (i.e. without broadening the discussion to other aspects present in the program).

Python: basic aspects (10h)
- Basic types and constructs
- Lists, tuples, dictionaries and sets
- Control structures, iterators and iterables
- Higher order functions, the notion of closure
- Decorators, generators and coroutines, recursion
- Namespaces and visibility rules (scope)

Object-oriented Python (14h)
- Classes and objects, first-class objects
- Methods and attributes
- Object creation protocol, __new__ and __init__ methods
- Multiple inheritance, metaclasses, the __call__ method, decoration with classes
- Attribute access protocol
- Information hiding in Python, property and methods to throw setters
- Other magic methods and related syntactic constructions
- Abstract methods and classes

Structuring and distribution of Python software (4h)
- Package management
- Organization of libraries, packages and modules
- Name imports
- Distribution of source and binary Python code

Functional programming in Python (8h)
- Notes on functional programming, limits and advantages
- Python functional programming tools: list comprehension, lambda function, map-reduce paradigm, eval function
- Modules for functional programming: operators, functools and itertools

C-Python interpreter and memory management (4h)
- C-Python approach
- Memory organization, allocation and release schemes (arenas, pools, blocks)
- Accessibility of objects, reference counting, the problem of loops and tracking of container-type objects
- Generations and their treatment

Software engineering in Python (8h)
- Debugging in Python, the pdb module
- Design pattern, examples of d.p. common
- Unit test, efficiency evaluation

Teaching methods

Ordinarily, teaching is based on lessons/exercises to be carried out partly in the classroom and partly in the computer lab. In the laboratory, in particular, Python will be used for the development of the front-end of a simple compiler/interpreter. All technical and organizational information about the course will be posted to the Moodle platform. The student is invited to register and consult this platform regularly.

Assessment methods

The exam consists of two parts. The first part is a practical test carried out in the laboratory to verify the ability to develop meaningful programs in Python, with a maximum duration of 1h and 30m, having as its object the development of (a part of) a significant Python program. The second part is an oral (or possibly written) test to verify knowledge on dynamic languages, consisting of questions on theory. Each test will have a mark expressed in a scale of 30 and the exam mark will be the average of the two marks.

Learning outcomes

- Knowledge and understanding: as the objective of the theoretical part, at the end of the course the student will have extensive knowledge on dynamic languages, their main characteristics, the differences with "static" languages ​​and the areas where a dynamic language such as Python can be advantageously used.

- Ability to apply knowledge and understanding: through the exercises in the computer lab, at the end of the course the student will be able to develop meaningful programs in Python, the most used and requested dynamic language in many work contexts.

- Autonomy of judgment: through both the theoretical lessons and the exercises, also using skills acquired in other courses, the student will be able to evaluate, independently of other conditioning factors, the characteristics of the language that best suit the applications that (s)he will be asked to develop. Students will be able to suggest / choose an appropriate language for the proposed objectives.

- Communication skills: lessons and exercises are carried out by the teacher with constant solicitation for participation by the students. In particular, the lab lessons require students to anticipate the solutions proposed by the teacher, discussing the criteria that suggested them and evaluating alternatives. The final interview then allows sudents to express the theoretical concepts learned with an appropriate language and support a discussion on the covered topics.

- Learning skills: the study of literature, discussions with the teacher, targeted exercises will allow the development of autonomous learning skills.

Readings

There is no reference text, the teaching material (lecture notes, notes available online, software, ...) will be made available by the teacher with indications given on the Moodle platform.