Content of the course #
This is a beginner’s course on imperative and (class-based) object oriented programming, with an emphasis on practice and collaboration.
We will use Java as our main programming language. However, for a large part, the content of the course is not specific to Java (although the syntax may be). This content can be easily ported to other (imperative and/or object-oriented) programming languages: C/C++, C#, Javascript, Go, Kotlin, Lua, Perl, PHP, Python, Rust, Ruby, Typescript, Visual Basic, etc.
Prerequisites #
Students are expected to have completed the Computer Programming course (INF/01 76203).
Therefore the following topics are not covered in this course:
- variables, assignments, variable scope,
- basic data types (
int
,char
,boolean
, etc.). - conditional statements (“if/then/else”) and loops,
- expression evaluation,
- methods/functions,
- arrays,
- etc.
Students are also expected to have played the board game used as a running example throughout the lectures.
Outcomes #
After completing this course, students should be able to:
- develop a prototype application in Java,
- write structured, documented and easily maintainable code,
- collaborate with other developers.
Focus #
Foundations #
Most lectures put an emphasis on problem solving, rather than providing (mechanical) recipes.
Besides, the amount of Java syntax provided in this course is on purpose limited (but sufficient to solve the assignments). For conciseness, pseudocode may even be used in some sections, rather than Java code.
Some lectures also focus on more abstract (albeit simple) notions.
These includes elementary mathematical objects or structures: set, tuple, map, relation, preorder, graph, tree, etc.
The purpose is twofold:
- generalize techniques seen in this course to programming languages other than Java,
- provide a widely accepted vocabulary to document/explain your code.
Collaboration #
The course introduces basic coding practices to ease development within a team. In particular:
- structuring a project (components, interfaces, encapsulation, inheritance, etc.),
- collaboration via git,
- [test-driven](% ref {{../../unittests/sections/tdd.md" %}}) development.
Note. What is considered good communication in computer science may differ from other disciplines. Emphasis is put on clarity, precision and conciseness.
Here is a (caricature of) a poorly documented method. Can you improve the method’s description and/or signature?
/** The algorithm looks at the first input collection, and is only guaranteed to
* work if no number is present twice in this collection, in which case it
* loops over the numbers contained in this collection (in no specific order)
* and checks for each number whether it is also present in the second input
* collection (which is also expected to have distinct numbers). The code
* written in this loop adds the current number (from the first collection)
* to the output collection if this number is also present in the second
* collection, and does nothing with this number otherwise.
*/
Collection<Integer> filterNumbersThatAreShared(Collection<Integer> c1,
Collection<Integer> c2);
A simpler signature and description could be:
/**
* Returns the intersection of sets s1 and s2.
*/
Set<Integer> intersection(Set<Integer> s1, Set<Integer> s2);
The following topics are beyond the scope of this course:
- continuous integration,
- project management (agile methodology, bug tracking, etc.),
- advanced git workflows,
- advanced design patterns, dependency injection,
- etc.
Quizzes #
Some lectures will include quizzes. These are anonymous, and therefore are not part of your evaluation. The purpose is to:
- make lectures more interactive, and
- adapt the pace of the lectures based on students’ answers.
Topics covered #
Due to limited time, many notions (such as asymptotic cost, hash tables or multi-threading) are only briefly introduced in this course. However, some of them will be further discussed in other courses of the bachelor.
Programming techniques #
An important part of the lectures is dedicated to the following core topics:
- objects, classes and interfaces (inheritance, encapsulation, value vs reference, comparing objects, cloning objects, etc.),
- abstract data types (set, list, associative array, queue, etc.) and data structures (array, linked list, hash table, etc.),
- recursion.
In addition, the following will be (briefly) introduced:
- mutability, pure functions, lambda expressions and streams,
- generics,
- multi-threading.
Note. Some of these topics pertain to functional programming, but have been incorporated (in some form) to several imperative languages over the years.
Software engineering #
- unit tests,
- exceptions,
- code factorization.
Java #
- input/output,
- object serialization, JSON/XML serialization.
Tools and tutorials #
- git,
- build automation (Maven and Gradle),
- using an IDE,
- using a terminal efficiently (introduction),
- etc.