I am not a programmer by any stretch, a psuedo shell scripter at best.
in reply to How to write long programms?
I look at writing long code like the old saying "how do you eat an entire cow?" - one steak at a time.
I always break the code into smaller parts and then work on one part at a time until i get each part to work correctly.
After I get one section of code to work the way i want, I start the next.
After that one is done, i try to tie the two together.
If they work correctly I go to the third and so on..
Just my thoughts