#Function Hierarchy?
20-Feb-92 00:21:28
Sb: #33790-#Function Hierarchy?
Fm: Tony Tanzillo [LISP TM] 71241,2067
To: Phillip E. Rutledge 70421,3012
Phil – The "secondary" functions, as you refer to them, are more commonly
thought of as "subroutines". There are many benefits to them. Mainly, they
allow you to write applications in a modular fashion, by breaking down every
task or problem into smaller ones, and dealing with each component problem
or task seperately, which thereby allows us to reduce the overall complexity
of an application. So, in the case of a large application, it often helps
to decompose it into many small logical 'modules', each of which is designed
to do a very specific and limited function. You can think of the hierarchy
of functions as a tree, where the root is the main program, and each branch
is a subroutine, which itself can branch to other "sub-subroutines".
In this analogy, as you get deeper into the tree (that is, further from the
'root' or main program), function or operation performed by each subroutine
will usually become more specific and limited in scope.
Additionally, if a procedure needs to be performed many times, and/or at
several different points within the same program, it makes little sense to
replicate the same code at each and every one of those points when instead,
the code could appear just once as a subroutine, and be "called" from many
different places.
<more>…