Breaking a Program Into Modules
00:00 There are four main advantages to breaking a program into modules. The first one is simplicity. Modules are usually focused on a single problem. Secondly, maintainability.
00:11 Small files are usually better maintainable than large files. Third, reusability. Modules reduce duplicate code. And the fourth advantage is scoping. Modules have their own namespace.
00:25 That’s quite convincing, no? Okay, agreed: the last point seems a bit like a disadvantage for now because you were running into a bunch of namespace errors when you were trying to import a function from another module.
00:37
So let’s investigate namespaces a bit more by investigating different import
statements in the next lesson.
Become a Member to join the conversation.