2. Getting started¶
A general introduction to programming using Python.
Goal
General introduction to programming using Python. While motivated by writing software for scientific data analysis, the contents as such are much more generally applicable.
- 2.1. Hello world
- 2.2. Language fundamentals
- 2.3. Organising code
- 2.4. Object-oriented programming (OOP): a primer
- 2.4.1. Motivation: Why object-oriented programming?
- 2.4.2. Paradigm shift: structured to object-oriented
- 2.4.3. The building blocks: objects and classes
- 2.4.4. The basic concepts: encapsulation, inheritance, polymorphism, composition
- 2.4.5. Object-oriented design and architecture
- 2.4.6. Object-oriented programming in Python
- 2.4.7. Wrap-up
The first section, Hello world, starts with a classic of learning programming in any language, printing out “Hello world!”. However, it takes you all the way from the command line to functions, classes, packages, and tests.
Next, we’re looking into fundamentals of programming languages such as syntax, types, and structures (conditionals and loops). This is pretty much the same for every programming language, and here, the specifics of Python are covered.
To get readable, reliable, and maintainable code, code organisation does matter quite a bit. Things to cover are namespaces and scope of symbols (variables, functions, classes), organising your code in files, and data structures.
The last section is an introduction into object-oriented programming (OOP), as Python is a fully object-oriented programming language and OOP actually provides some very powerful abstractions for organising code and programs.