documentation: what is the correct term, function or command
- 
				DarkDragon
- Addict 
- Posts: 2347
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
In a procedural language?DarkDragon wrote:'method' is the professional way to say procedure/function/command.
Edit:
mskuma, my take, FWIW: Anything you decide is going to be a plus, as long as you achieve a standard of some sort in the docs.
Thanks again.
					Last edited by Dare on Fri Aug 11, 2006 1:15 pm, edited 1 time in total.
									
			
									Dare2 cut down to size
						> 'method' is the professional way to say procedure/function/command.
'method' is OOP terminology, and implies that a method is part of some class/object.
mskuma & Killswitch
You can go with 'function', no problem. It does not make a real difference as long as its used consistently imho.
			
			
									
									'method' is OOP terminology, and implies that a method is part of some class/object.
mskuma & Killswitch
You can go with 'function', no problem. It does not make a real difference as long as its used consistently imho.
quidquid Latine dictum sit altum videtur
						Why make things "complicated"? Just call them all one thing (function, procedure, command, whatever) and just accept that some may return a result and some may not.
Or, what everyone else said
Personally, I still haven't adapted to using "Procedure" instead of "Function", and now with Macros I can have it my way!
On a side note about Methods: When (if?) PB becomes an OOP language, the distinction between function and method will be even more important. Maybe PB could call them LocalProcedure (Method) and GlobalProcedure (Function)?
I guess we'll leap over (off?) that bridge when we get to it...
Russell
			
			
									
									Or, what everyone else said

Personally, I still haven't adapted to using "Procedure" instead of "Function", and now with Macros I can have it my way!

On a side note about Methods: When (if?) PB becomes an OOP language, the distinction between function and method will be even more important. Maybe PB could call them LocalProcedure (Method) and GlobalProcedure (Function)?
I guess we'll leap over (off?) that bridge when we get to it...

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
						*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
I know this is a late reply, but here goes.
For consistancy, since the Procedure keywork is used to define functions and procedures anything that uses that is defined by the keywork Procedure should be called a procedure. The term function is used to denote how a Procedure may be used in a particular programming example. A note should be placed in the documentation regarding procedures that they may be referred to as Functions at different places in the docs depending on how they would be used.
The word function is frequently used to describe what is available through a library (i.e. 2dDrawing) and might be better adopted for things defined there.
Commands would likewise be a synonym for keyword. These are all pre-defined keywords used for syntax and should not depend on a separate library.
Demivec
"Better late than..."
			
			
									
									
						For consistancy, since the Procedure keywork is used to define functions and procedures anything that uses that is defined by the keywork Procedure should be called a procedure. The term function is used to denote how a Procedure may be used in a particular programming example. A note should be placed in the documentation regarding procedures that they may be referred to as Functions at different places in the docs depending on how they would be used.
The word function is frequently used to describe what is available through a library (i.e. 2dDrawing) and might be better adopted for things defined there.
Commands would likewise be a synonym for keyword. These are all pre-defined keywords used for syntax and should not depend on a separate library.
Demivec
"Better late than..."
Going with function seems to be a wise choice:
http://en.wikipedia.org/wiki/Subroutine
So in other words, the section of the PB manual named "Basic Keywords " actualy list the commands (if, then, else, etc) they are part of the language syntax.
When it comes to subroutines I tend to interchange function and procedure a bit.
Mostly I tend to call larger subroutines for procedures,
and smaller or native (built in or PB library) subroutines for functions.
It may be wise throw in a link in the PB manual to the wikipedia page url above as it covers the subject rather well.
			
			
									
									
						http://en.wikipedia.org/wiki/Subroutine
http://en.wikipedia.org/wiki/Command_%28computing%29In computer science, a subroutine (function, method, procedure, or subprogram) is a portion of code within a larger program, which performs a specific task and is relatively independent of the remaining code. Maurice Wilkes, Stanley Gill, and David Wheeler are credited with the invention of the subroutine (which they referred to as the closed subroutine).
A subroutine is often coded so that it can be executed ("called") several times and/or from several places during a single execution of the program, possibly even by itself. Mainly because of this feature, subroutines are a powerful programming tool. Judicious use of subroutines (for example, through the structured programming approach) will often subtantially reduce the size and cost of a program, while improving its readability and reliability. Subroutines, often collected into libraries, are an important mechanism for sharing and reusing code.
EDIT:In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell.
Specifically, the term command is used in imperative computer languages. These languages are called this, because statements in these languages are usually written in a manner similar to the imperative mood used in many natural languages. If one views a statement in an imperative language as being like a sentence in a natural language, then a command is generally like a verb in such a language.
So in other words, the section of the PB manual named "Basic Keywords " actualy list the commands (if, then, else, etc) they are part of the language syntax.
When it comes to subroutines I tend to interchange function and procedure a bit.
Mostly I tend to call larger subroutines for procedures,
and smaller or native (built in or PB library) subroutines for functions.
It may be wise throw in a link in the PB manual to the wikipedia page url above as it covers the subject rather well.
Example of the inconsistencies in manual:
Personaly I consider anything that does not have a () after it (i.e not a procedure/function/etc) to be a command.
Basically the same that wikipedia states about commands.
			
			
									
									
						This is basically a command, so the "function" later should be xchanged to command as well.Others Commands
Syntax
Goto <label>
Description
This command is used to transfer the program directly to the labels position. Be cautious when using this function, as incorrect use could cause a program to crash...
Personaly I consider anything that does not have a () after it (i.e not a procedure/function/etc) to be a command.
Basically the same that wikipedia states about commands.
Hi Rescator, I agree about the inconsistency (this was why the issue was raised in fact). I've updated the English version of the doc (CVS) to resolve this inconsistency - by using 'function' or 'functions' throughout (except for command-line references of course). I was also thinking the same thing about including the wikipedia references, but had put the idea to one side. Thanks for raising it.
			
			
									
									
						



