July 2022
Intermediate to advanced
304 pages
7h 6m
English
So far, we’ve been using a design pattern called “one big mess.” All code is dumped into main, and all variables are defined at the beginning of the program. This method works fine when your program is 100 or fewer lines long, but when you’re dealing with a 500,000-line program, you’re going to need some organization. This chapter discusses ways of limiting the scope of variables and instructions so you can make long, unmanageable blocks of code easier to understand, manage, and maintain.
For example, you can use a global variable anywhere in a program. To know where and how it’s used in a 500,000-line program, ...
Read now
Unlock full access