Computer Programming

A.Y. 2018/2019
12
Max ECTS
120
Overall hours
SSD
INF/01
Language
Italian
Learning objectives
Obiettivo del corso è introdurre gli studenti alla programmazione imperativa e al problem solving in piccolo. Come linguaggio di riferimento verrà utilizzato Go, ma nell'ultima parte del corso si insegnerà anche C. Il laboratorio è parte integrante del corso destinata a fornire la necessaria e naturale controparte "pragmatica".
Expected learning outcomes
Obiettivi didattici

Il corso ha come scopo che lo studente acquisisca una serie di conoscenze, abilità e competenze, le principali delle quali sono:

Conoscenze
- Conoscere i concetti fondamentali della programmazione imperativa strutturata
- Conoscere gli elementi principali della sintassi e della semantica del linguaggio di programmazione Go

Abilità
- Riconoscere l'uso di un pattern all'interno di una porzione di codice
- Identificare porzioni di codice critiche in relazione ad un comportamento osservato
- Scegliere e applicare un opportuno pattern per automatizzare un compito semplice
- Tradurre in Go un semplice algoritmo descritto in linguaggio naturale

Competenze
- Interpretare e descrivere il comportamento di un programma semplice quando viene eseguito
- Comprendere che cosa fa un semplice programma e riconoscere come le varie parti di cui è composto contribuiscano al suo funzionamento
- Stabilire le cause di un malfunzionamento e intervenire su un programma semplice per correggerlo/modificarlo
- Scrivere e mettere a punto un programma per automatizzare un compito semplice
Single course

This course cannot be attended as a single course. Please check our list of single courses to find the ones available for enrolment.

Course syllabus and organization

Milan

Responsible
Lesson period
First semester
ATTENDING STUDENTS
Course syllabus
SYLLABUS DRAFT
[TWG = The Way to Go: A Thorough Introduction to the Go Programming Language by Ivo Balbaert]
1. Course introduction; Computer architecture; Computer science; Programming languages ​​(machine language, assembly, high level); Computer as a programmable machine
2. The von Neumann machine. Information (bits, bytes, ...). Loader, fetch-decode-execute. CPU architecture: ALU and CU. An example of a CPU; assembly languages
3. Software lifecycle. Programming tools. History of go. The first program in go [TWG4]. The go tool. Compilation. Execution. Formatting. Documentation [TWG3]
4. Discussion of lexical and syntactic aspects. Comments [TWG4]. Types. Classification of types (basic types, compound types, interfaces). Variables: name, type, value, scope. Multiple declaration, assignments, short-assignment [TWG4]
5. Basic I / O. Basic numeric types (int, float64). Numerical expressions. Conversions. Introduction to the complex type. Unused variables and blank variable [TWG4]
6. Binary selection (if). Local variables. The bool type and the Boolean operators. Exercises [TWG5]
7. The iteration (for): unary, ternary, zeroary versions. Exercises [TWG5]
8. Digital representation of data. Positional notation. Representation of negative integers. Representation range, overflow. Overview of the representation of the reals: fixed and mobile point (IEEE 754 standard). Characters (ASCII, Unicode, UTF-8) [Handouts]
9. Fixed-length numeric basic types. Rune type. String type: differences between raw and utf-8. Len function. Fourth form of the for (range) cycle [TWG4, TWG5]
10. Exercises: nested cycles. Break and continue instructions [TWG5]
11. Multi-way selection (switch) [TWG5]
12. Arrays and slices. Initializers. Application of the for ranges. Append function [TWG7]
13. Exercises. Command-line arguments. Strconv package
14. Functions: parameters, signature. Passage by value. Returned values. Values ​​returned with a name. [TWG6]
15. Exercises
16. Sorting and binary research
17. Generation of pseudo-random numbers. Math package. Exercises
18. Maps. Application of the for ranges. Exercises [TWG8]
19. Recursion. Execution stack [TWG6]
20. Exercises using recursion
21. Pointers: operators * and &. [TWG4]
22. Exercises with pointers
23. Structures [TWG10]. Methods [TWG10] (outline)
24. Exercises on structures and methods
25. Closures. Example: sort, binary search
26. Advanced I / O. File [TWG12]
27. Exercises; defer [TWG6]
28. Packages and structure. Visibility of the variables
29. Testing [TWG13]
30. Interfaces [TWG11]
31. Implementation of a search engine (reverse indices)
32. Go routines and channels [TWG14]
33. Exercises on concurrency
34. The C language. Using gcc. Syntactic differences: point-and-comma, brackets in control structures, declarations of variables, types and functions. Differences in flow-control structures (switch, while, do-while). Use of simple instructions in control structures. Inclusion vs. import.
35. Absence of strings, slices, maps; use of char[] for strings. Elementary types and compiler dependency; use of specific types (stdint.h, bool.h). Implicit cast. Definition of macros. Library functions. Command line parameters
36. Pointers, pointer arithmetic. Memory management: malloc, free
NON-ATTENDING STUDENTS
Course syllabus
-
INF/01 - INFORMATICS - University credits: 12
Laboratories: 48 hours
Lessons: 72 hours
Shifts:
Professor: Boldi Paolo
Turno A
Professor: Morpurgo Anna Chiara Giovanna
Turno B
Professor: Trentini Andrea Mario
Turno C
Professor: Capra Lorenzo
Professor(s)
Reception:
by appointment
room 5003, via Celoria 18
Reception:
to schedule a meeting please send an email
room 4007, via Celoria 18, MI