Here is a proposal for Gnoga coding guidelines:

Version numbering:
m.n with m major version number , n minor version number.
-alpha is added on m.n when this version is created, to be used without any 
-beta is added on m.n when this version is enough mature to be tested.
Then a letter is added on m.n when this version becomes a stable reference 
release (fully tested).
The letter is incremented when fixes come.
For instance : 1.2-alpha, 1.2-beta, 1.2a, 1.2b, 1.2c…
Several lines of fixed comments customized with the name of the unit, the 
creation date and the name of the author.
Example: ...

Purpose of the unit:
Several line of comments indicating the purpose of the unit after header and 
before first declaration.
Example: ...

Coding style:
Line length is limited to 120 characters.
Ada keyword are in lower case.
Ada entities are in mixed case with an underscore to separate words.
Example: ...

Getter and setter names are identical as Ada provides function for getters and 
procedure for setters.
Example: ...

Entity description is lines of comments below the entity declaration.
Gnatdoc annotations are recommended, see 
Example: ...

Ada contracts Pre, Post and type invariant are recommended.
Example: ...

Ada type entity is ending with "_Type" for a common type, "_Access" for an 
simple access type, "_Class" for an access to class type.
Example: ...

Functions and procedures must be declared before coding the body.

Use clause is restricted to minimum use, preferably local use to functions or 
procedures. Use type clause is recommended.

Code reformat is recommended before commit to Gnoga repository.
Example: ...

Syntax check is mandatory before commit to Gnoga repository.
Example: ...

For debug builds, most warnings, runtime verifications and exception tracebacks 
are recommended.
Example: ...

For release builds, runtime verifications disabled and optimisations enabled 
are recommended.
Example: ...

Implementation must target Linux, macOS and Windows platform.

Feel free to give your feedback, Pascal.

Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Gnoga-list mailing list

Reply via email to