Page 2 of 2

Posted: Fri Aug 11, 2006 1:10 pm
by DarkDragon
'method' is the professional way to say procedure/function/command.

Posted: Fri Aug 11, 2006 1:11 pm
by Dare
DarkDragon wrote:'method' is the professional way to say procedure/function/command.
In a procedural language?


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.

Posted: Fri Aug 11, 2006 1:15 pm
by freak
> '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.

Posted: Fri Aug 11, 2006 1:27 pm
by Kale
freak wrote:mskuma & Killswitch
You can go with 'function', no problem. It does not make a real difference as long as its used consistently imho.
Exactly what i said. :wink:

Posted: Fri Aug 11, 2006 4:39 pm
by Amiga5k
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

Posted: Sat Aug 12, 2006 1:15 am
by mskuma
OK, we're going with function. Thanks everyone for your input.

Posted: Fri Aug 18, 2006 9:45 am
by Demivec
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..."

Posted: Fri Aug 18, 2006 10:06 pm
by Rescator
Going with function seems to be a wise choice:

http://en.wikipedia.org/wiki/Subroutine
In 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.
http://en.wikipedia.org/wiki/Command_%28computing%29
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.
EDIT:

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.

Posted: Fri Aug 18, 2006 10:19 pm
by Rescator
Example of the inconsistencies in manual:
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...
This is basically a command, so the "function" later should be xchanged to command as well.

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.

Posted: Fri Aug 18, 2006 10:28 pm
by Rescator
I gotta stop typing in this damn heat. I totally missed the fact that
blueznl said exactly my view and that mskuma allready dug up the 'pedia links. *DOH!*

*crawls back to his corner again*

Posted: Fri Aug 18, 2006 10:28 pm
by mskuma
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.