Re: lexical question

Subject: Re: lexical question
From: Richard elGurutm Howland-Bolton <reh1 -at- CORNELL -dot- EDU>
Date: Tue, 29 Jun 1993 13:46:03 -0500

>What is the difference between a function, routine, and subroutine?

>I'm documenting a programming library to be used by programmers
>writing network applications. The source material uses the above
>words interchangably. Are they synonymous? I know a function
>returns a value, but I can't find a definition of routine or
>subroutine.

>Also, when referring to the functions (or whatever?) should I use
>parens? For example:
> The add() function returns a value.

> or should I leave the parens off. Thanks in advance,

> Amy

This is how I look at those terms:
A routine is a piece of code that does something.
A subroutine is a routine that is called
(often many times) by other routines.
A function is a routine that returns a value
(you answered that one yourself :-) )
Their use is relatively relative -- for
example you might have an "average" routine that
repeatedly calls your "add()" as a subroutine.
Each time "add()" gives "average" a number, and
so acts as a function.

If your environment has a need for parens then
I'd include them, at least in examples.

Sorry this is hurried.
r h-b

Richard E. Howland-Bolton Cornell University
Manager Publications Computing Publications Guru
Internet: reh1 -at- cornell -dot- edu You can ftp to: 132.236.39.28
Compuserve: 71041,2133 AppleLink: CUGURU
Voice: (607) 255-9455 FAX: (607) 255-5684
Post: Publications, East Hill Plaza, Ithaca, NY 14850
-------------------------------------------------------
"I'll have my computer get in touch with your computer"
-------------------------------------------------------


Previous by Author: Re: Enough already!
Next by Author: Re: Professionalism
Previous by Thread: Re: lexical question
Next by Thread: Re: lexical question


What this post helpful? Share it with friends and colleagues:


Sponsored Ads