Module 2: OOP, Code Style, and Reviews
Module Overview
When you're a software engineer, you're not just writing code for your own immediate needs - you're building a system that others will work on, from coworkers and open-source collaborators to future-you. To do this, we must write code based on shared design and style principles.
In this module, we will learn the basic principles of object-oriented programming (OOP), the most common paradigm for designing and building large codebases. We will also learn about standard code style, tooling, and the code review process.
Learning Objectives
- Create a basic Python class with a constructor, methods and fields
- Write stylistic (PEP 8) Python code and use a linter to encourage cleanliness and organization
Guided Project
In this guided project, we'll apply our knowledge of OOP principles and Python style guidelines to create well-structured, readable code. Open guided-project.md in the GitHub repository below to follow along with the guided project.
Module Assignment
For this assignment, you'll apply object-oriented programming principles and Python style guidelines to create clean, well-structured code that follows industry best practices.
Solution Video
Additional Resources
Object-Oriented Programming
Code Style & Tools
- PEP 8 — the Style Guide for Python Code
- Google Python Style Guide
- Python extension for Visual Studio Code
- autopep8: Python tool