Hi, Studying various ETH routines, I sometimes see Variable in capitals, sometimes lowercase. Is there a coding style to follow, e.g. globals get capitals, local lowercase, constants, etc? Many thanks Tomas
Hi Tomas There are no fixed rules for it. If there were, the compiler would enforce them :-) However there are some rules of thumb: Wirthian languages Pascal, Modula-2 and Oberon generally use Capitalized or UpperCamelCase identifiers for programs, modules, constants, types and procedures, and lowercase or lowerCamelCase identifiers for math constants, variables, formal parameters and functions. Jörg
Am 11.04.2017 um 14:05 schrieb Tomas Kral <thomas.kral@email.cz>:
Hi,
Studying various ETH routines, I sometimes see Variable in capitals, sometimes lowercase.
Is there a coding style to follow, e.g. globals get capitals, local lowercase, constants, etc?
Many thanks Tomas -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Dear Jörg, and what is difference between constants and math constants? Give an example, plz. Jörg пишет:
use |Capitalized| or |UpperCamelCase| identifiers for programs, modules, constants, types and procedures, and |lowercase| or |lowerCamelCase| identifiers for math constants, variables, formal parameters and functions.
Jörg
-- Oleg N. Cher
CONST Width = 100; pi = 3.1415926535; Jörg
Am 11.04.2017 um 18:31 schrieb Oleg N. Cher <allot@bk.ru>:
Dear Jörg,
and what is difference between constants and math constants? Give an example, plz.
Jörg пишет:
use |Capitalized| or |UpperCamelCase| identifiers for programs, modules, constants, types and procedures, and |lowercase| or |lowerCamelCase| identifiers for math constants, variables, formal parameters and functions. Jörg
-- Oleg N. Cher -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi, I have spotted another defacto coding rule, generic types/objects as parameters are single letter capitalised. B: Bitmaps T: Texts R: Rider S: Scanner W: Writer however files, are sometimes lower case f: File Tomas On Tue, 11 Apr 2017 14:23:14 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
Hi Tomas
There are no fixed rules for it. If there were, the compiler would enforce them :-)
However there are some rules of thumb: Wirthian languages Pascal, Modula-2 and Oberon generally use Capitalized or UpperCamelCase identifiers for programs, modules, constants, types and procedures, and lowercase or lowerCamelCase identifiers for math constants, variables, formal parameters and functions.
Jörg
Am 11.04.2017 um 14:05 schrieb Tomas Kral <thomas.kral@email.cz>:
Hi,
Studying various ETH routines, I sometimes see Variable in capitals, sometimes lowercase.
Is there a coding style to follow, e.g. globals get capitals, local lowercase, constants, etc?
Many thanks Tomas -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (3)
-
Jörg -
Oleg N. Cher -
Tomas Kral