L3IF Programming

Lecture notes by François Schwarzentruber (Work in progress)

Acknowledgement

I want to thank Michele Pagani for his support, as well as Alice Brenon and François Pitois.

Why such a course?

  • Because you may become:
    • a researcher, and you need to program prototypes or participate to the development of research software
    • a teacher, and you will teach programming too and develop tools for your courses
  • Because you need to program in other courses.
  • Because it is fun to program!

Content

This course covers the C programming language and Python .

Motivation: why studying C and Python?

Cool to study both

With C and Python we cover various aspects of programming:


CPython
low-levelhigh-level
memory handled by handmemory handled automatically
statically typeddynamically typed
weak typesstrong types
compiled languagecompiled in byte-code, then interpreted
tedious to install librairiesvery easy to install librairies, via pip <3

Noticeably:

  • Possible to do bindings C/Python
  • Actually many Python librairies are written in C, C++ etc.
  • They are both successful languages
  • They are languages used at agrégation d'informatique

Why C?

  • C is simple (KISS!)
  • With C, you will understand how your computer works
  • Important for your system and architecture courses
  • C is still used for system development (but not so much!)
  • The syntax of C is in many languages
  • A way to understand Rust, C++... and actually programming in general (and Tensorflow is coded in C++)

Why Python?

  • Python is really really really used everyhere (data science, machine learning, software development, backend, etc.)
  • Python has good libraries
  • Python is elegant
  • Python steals good features from other languages (Haskell, object-programming languages)
  • Python is used in education
  • A way to understand OOP, Javascript, other script languages
  • Python has a strong community

The Zen of Python

Good practice

  • git
  • tests
  • bonnes structures
  • commentaires (spécifications)
  • good variable names, etc.
  • encapsulation
  • abstraction

Histoire

https://fr.wikipedia.org/wiki/Histoire_des_langages_de_programmation https://en.wikipedia.org/wiki/Timeline_of_programming_languages

Exercices

  • Collect few software or libraries you use and look in which languages they have been developped

Aller plus loin