TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
>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"
-------------------------------------------------------