• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Vocabulary - Which word for functional entity in code? Command, Expression, Directive.

Phil7

Moderator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
886
When rewriting the docs, I have some problems with choosing the right words:

First something I am pretty sure about. I am going to change the word "Identifier" to "...Name".
For example Function FunctionName:ReturnType(ParameterName:ParameterType)


The second thing is, that I don't have a suitable word for a functional entity that you usually have as one line of code.
I tend to use the word "Command", because it is usually not that well and rigidly defined compared to "Directive, Expression, Statement"

I see the need for this kind of didactical reduction to enable an easy to understand language without having to lookup every word in the docs while not using technical terms incorrectly
 
First thing sounds good. In the second case I don't really understand...? You're looking for a generic name that kinda hosts "directive, expression and/or statement", right? Why not term or phrase? I feel like command is a one-thing thing (like in command line tool, where you have a command followed by parameters. You could also check Unix manuals for how they call multi-command terms (e.g. when piped))
 
check Unix manuals for how they call multi-command terms
I will do that.

You're looking for a generic name that kinda hosts "directive, expression and/or statement"
Right, and also nearly everything else.
"Term" sounds to mathematical in my ears, while "phrase" sounds like multiple statements.

I feel like command is a one-thing thing
Yes, that's also true for old basic style where you didn't nest to many things in one line.
But I guess from a command line tool you are also used to have quite complex terms even if they are following this "command parameters" style, like "git config --global alias.br branch"
 
FWIW at someone who is a veteran programmer but new to CX...

A one-line piece of code that encapsulates its behaviour... that's a statement.

Code:
DrawImage myImage, 30, 50

A function call, yes, mechanically, but it's a statement. Even if you stack things on it like we did back in the BASIC days, that's still individual statements.

As far as:
Code:
Function FunctionName:ReturnType(ParameterName:ParameterType)

is concerned, that absolutely works, is unambiguous and while one could argue less technically correct, it's far more semantically useful.
 
My two pence worth

An identifier can be either a variable, parameter, function or method name.

Terms to use:
Cerberus:
Function MyFunction:Int( parma1:int, param2:int)  << "Header" Function or Method Note the start of a class would be a header
A:       B:         C:   D:     E:   D:     E:

A Keyword Function or Method
B Function or Method 'identifier'
C Return Data Type
D Parameter identifier
E Parameter Data Type

ReturnVal  =  MyFunction( myval1,myvar2 ) << B: Function/Mehtod Call
A:         B: C:          D:     D:

A LValue identifier
B Assignment operator
C RValue function or method identifier
D Parameter identifier, function expression to pass

Local MyVar:Int  =  5 << Variable declaration
A:    B:         C: D:

A Keyword
B LValue Variable identifier
C Assignment Operator
D RValue can be a Literal, expression or identifier
 
Maybe a stupid question but.. Why should there be a differentiation between methods and functions? Is it purely because functions are supposed to give you something back in return of every call?
 
I am aware that there are different names for different things that can show up in a line, even if I am no expert in these terms.
What I am after is a word that describes all of them.
Just like you have apples, pears and cherries. You still need the word "fruit" to talk about these things.

If "statement" is the term to go. Is this technical term really fitting all the normal lines of code (line comments excluded) ?
like:
Strict
Import mojo
Local a:Int=5
Class Animal
ElseIf b>7
Until c = 5
#Rem
End

For native english speakers:
"Statement" has the german translation "Anweisung", which is nearly synonym to "command" in english. It seems "statement" has not really the same meaning as "command" and its range of possible meanings is pretty wide, right? I am looking for a term that describes the technical word "statement" (or whatever fits my needs here) in everyday language.
 
For native english speakers:
"Statement" has the german translation "Anweisung", which is nearly synonym to "command" in english. It seems "statement" has not really the same meaning as "command" and its range of possible meanings is pretty wide, right? I am looking for a term that describes the technical word "statement" (or whatever fits my needs here) in everyday language.
You may as well just do what every programming manual since the first computer became available to the general public........
Have a glossary of terms used.
 
every programming manual since the first computer became available to the general public........
Have a glossary of terms used.
Maybe that is the reason why most of them are unreadable for beginners. To do that you could also just link to the explanation on wikipedia.
I want to make it readable for beginners without having to look up every second word.
 
What I am after is a word that describes all of them.

Maybe the word you are looking for is Instruction?
Basically when you programming you are giving instructions what to do.

Assign this value to this variable
Check If this statement is true and if it is Then do this Else do that
Repeat this instruction(s) this many times using this Loop
Define a class with this name that extends from this other class and implements this Interface
Define the fields and methods of the class
Create an instance of an object
Call this method of this object
Set/Get the value of this object's property and this variables
..etc

All this can be described as an "Instruction" in my opinion. They are instructions.
 
Last edited:
Maybe a stupid question but.. Why should there be a differentiation between methods and functions? Is it purely because functions are supposed to give you something back in return of every call?

Because the language does, though in practice it's a semantic one.

Functions live generally, methods explicitly live in classes. A lot of languages just use the keyword 'function' to delineate that it's a function that operates on parameters and has a return, but Cerberus seems to delineate on scope rather than languages like VB where 'function' has a return and 'sub' does not.

I want to make it readable for beginners without having to look up every second word.

Then perhaps the way to go is to drop the formality behind terminology and be more descriptive. A function is 'a block of code that does x, you give it this parameter and this is the outcome'.

It's been a while since I really wrote documentation for beginners though :(
 
Back
Top Bottom