[Tutor] functions first?
Alex Kleider
akleider at sonic.net
Tue Jan 27 20:15:40 CET 2015
On 2015-01-27 00:15, Alan Gauld wrote:
> On 27/01/15 02:04, Alex Kleider wrote:
>> Please correct me if I am wrong, but I've assumed that it is proper to
>> define all functions before embarking on the main body of a program.
>
> No, you can do it either way round. Top-Down or Bottom-Up as they are
> known.
>
> Usually its a muxture of both.
>
> But most folks like to have a running program at all times. So you
> might write the function headers with dummy bodies then write the main
> code that calls the functions. Then go back and fill in the functions
I've just realized where the confusion arises.
As Steve guessed, I was talking about the order in which they appear in
the file,
not the order in which they were written. Only when this light went on
did I
realize why I had inadvertently precipitated a discussion of top down vs
bottom up
design.
Sorry about the confusion.
More information about the Tutor
mailing list