In the case of application-specific functions that calls other
application-level functions, you debug by writing the lower-level
functions and test them until you are satisfied that they are
correct. Then, you write higher-level functions that use the functions
that you have just debugged, and verify that you get the expected
results. Since you have already verified that the lower-level
functions work correctly, you can focus on the higher-level
functions. Continue this process until you get to the highest-level
function, and you'll have a complete program that has been more
thoroughly debugged and tested than you can expect to see for programs
written in a top-down style, or in a less interactive environment.
By writing the code in this manner, you are building your
program in a bottom-up style. You are also effectively coding and
planning at the same time.
--
Raymond Wiker, Orion Systems AS
+47 370 61150
Since when a three ISO-A4 pages long function/procedure containing
five different loops (some nested) is 'simpler' than a bunch of
separate functions doing exaclty what they advertise?
The rule of thumb should be: if it fits in a 50/60 lines Emacs frame
it's borderline :) (I have been generous :) ) Anything longer is a
candidate for a rewrite. Anything shorter may be as well :)
Cheers
--
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26
http://www.parades.rm.cnr.it/~marcoxa