Content

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.

The course relies on Java as main programming language. However, many concepts seen in this course are relevant 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 76258).

Therefore the following topics are not covered in this course:

  • variables, assignments, variable scope,
  • basic data types,
  • 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 syntax. For conciseness, pseudocode may 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.), regular languages, etc.
The purpose is twofold:

  • facilitate the application of 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, etc.),
  • factorizing code (inheritance, reuse of methods, etc.),
  • test-driven development,
  • collaboration via git.

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 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
 * 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 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);

However, 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.

It is in your own interest to answer them without external resources (web, chatbots, IDE, etc.).

Here is a link to the first quiz: https://forms.gle/7Y2MpzE7v5xzUJFy7.

Topics covered #

Due to limited time, many notions (such as asymptotic cost, regular languages, 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 concepts and 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:

  • regular expressions,
  • generics,
  • mutability, pure functions, lambda expressions and streams,
  • 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 #

  • compilation/interpretation, bytecode, JVM and JDK,
  • 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.