From the course: Introduction to Career Skills in Software Development
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
How to organize your code - Python Tutorial
From the course: Introduction to Career Skills in Software Development
How to organize your code
- [Instructor] Your files can get long and unruly as you add more code to your classes. To keep things neat and organized, it's best to store your classes in modules. A module is a file consisting of Python code. It can define functions, classes, variables, and more. There are several advantages to breaking up code in a large application. The first is simplicity. A module typically focuses on one piece of the software puzzle. This makes development easier and less error-prone, as you don't have to keep the entire domain in your head at the same time. Maintainability, if you write your modules so that there's little dependency between them, it's easier to make changes that won't impact other parts of the program. This is also a great way to support collaboration on a shared code base among programmers, as you've reduced the chances of conflicts when changes are made. Finally, reusability. By placing code in modules…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.