When you are required to debug the program, bugs could be much more easier to find out as the program is sliced into smaller chunks. You may run the program and notice a mistake at a certain point and which is located in a particular procedure/function. It would be much more difficult to find a mistake in a program if it would be one whole piece of code. Do slice your program into smaller chunks, and this needs design of the whole problem in hand prior to coding. Coding (or writing up your program) is just one section of the whole software developement process. The whole Software Developement Processis an important part of nowadays scientific computing.