Modular programming is an essential tool for the modern developer. Gone are the days when you could just throw something together and hope that it works. To build robust systems that last, you need to understand how to organize your programs so that they can grow and evolve over time. Spaghetti coding is not an option. Modular programming techniques, and in particular the use of Python modules and packages, will give you the tools you need to succeed as a professional in the fast changing programming landscape.
In this chapter, we will:
Look at the fundamental aspects of modular programming
See how Python modules and packages can be used to organize your code
Discover what happens when modular programming techniques are not used
Learn how modular programming helps you stay on top of the development process
Take a look at the Python standard library as an example of modular programming
Create a simple program, built using modular techniques, to see how it works in practice
Let's get started by learning about modules and how they work.