Imagine if your program was 10,000 lines of code (or more). That single file would be very hard to manage. The best practice in software engineering is to divide your code into modules which is why you will find most experienced programmers on this forum supporting the idea.Maybe its just me, but having a program split into many small files is irritating and difficult to use. I then have to try to remember which file the code is in too. I often look back at previous routines to see what it does. That is the main reason I hate programming in C, all of the many files that are used make it very difficult to find where a constant is defined or where a function is located. Its probably just me, but if the whole program is in one file, I can find everything easily.
Some languages term modules classes or whatever but the concept is the same - functionality is encapsulated into one place which can be reused. A module usually has a well-defined and documented public interface and that is all you need to remember - the internals are hidden and not exposed. This means that you actually have to remember a lot less and there are usually less defects introduced into the code
If you read my ZBasic application notes on interfacing to various devices, you will find that the functionality is divided into a main tester routine and then one and sometimes more modules that implement a specific function. I did this to promote reuse.
So for example let's say you were building a fire-fighting robot. First take the ultrasonic module (SRF05.bas) from AN-215, thermal sensor module (TPA81.bas) from AN-212, LCD module (LCD03.bas) from AN-214, and the remote control modules (IR.bas, SonyIRCodes.bas) from AN-204. Then write your own motor control module (e.g. Motor.bas) using PWM and add a main routine in Robot.bas. More than 50% of the code has already been written and tested for you and you just need to add a bit more to have a fully-functioning robot.
Even if you were starting from scratch, it is still a good practice to separate out your code. This provides a divide and conquer approach to solving the problem as you build up the solution, module by module.
If you want to compare this idea to hardware, you can think of each module as a separate chip. Each chip has a well-defined interface (the datasheet) and an implementation that is hidden (the silicon) which almost all people don't care about. If you look at the ZX-24ae device for example, you can think of that as a "super-module" that has been tested and is ready to use.