These are OUR Coding Standards. Good use of a programming language should cover the format of the code in addition to how coding constructs should be produced, and qualifiers used. The standards applied to code on this site, are independently drawn up, and to our knowledge, not currently in use by any organisation. For further clarification on this, refer to our full disclaimer.
That said, it must be pointed out that our standards are not the same as those applied by the Gembase utilities like the Forms Editor. Complex coding constructs are not readily visible when these tools are used, and simple things like the layout of a program can make a significant change to the amount of time required to locate and fix a problem. Our standards are aimed at producing maintainable, reusable, efficient systems.
Our Coding Standards set out to encourage quality development, by encouraging a common set of practices which are open to any interested parties to adopt. By raising the promenance of these proposals, we hope to encourage use of Gembase for development, that development being done to high standards.
The serious stuff out of the way, the more people use our coding standards, the more code we can all easily understand and follow. As this site develops, we hope to be able to address many frequently encountered problems, and many uses of code that can be standardised to ensure the object of a piece of code can be understood.
As an open standard, we will take any contributions posted in the forum and may add them to our own examples when they are posted. In this respect, we will reformat programs before posting in the main part of the site. Original contributions will be credited, but it is the responsibility of the poster to ensure that they own the copyright on the material, or have permission from the copyright holder.
The rules which we advise for the layout of Gembase ensure that indentation is used to ensure that the structure of a program can be easily followed from the code. By use of rules on this, spacing, and case, programs can be made easier to read and comprehend.
The rules applied to the case of code are the simplest. All code, except variables, is in uppercase. This is close to the code poduced by the Gembase utilities so little effort is required when applying this standard to generated programs. In this way, variables stand out, and if hard coded text is present, it can be easily found and replaced with messages to ease language translation.
But, as with all our standards, further use of the Gembase utilities such as the Forms Editor, will modify the case and layout of the code, thus removing any advantage to be gained from these standards. To combat this, we provide a small example of code which, when encountered by the Forms Editor, will result in the editor refusing to allow the program to be loaded for modification. Forms Editor Blocker.
This short example has been formatted to our standards for code layout, by use of spacing, and minimising excess parenthesis and qualifiers, we aim for neat, consistent, and clean code. Firstly, we have our Rules For Indentation which define the visible flow of the code and place some common-sense restrictions on use of some constructs.
When developing in Gembase, personal preferences will dictate which editor you use, on VMS systems the supplied editors are pretty good, we advise setting the cursor to be bound to the flow of the text, and ensuring the initial indentation of code is done with tabs. For developing on the PC, we recommend P.F.E. (Programmer's File Editor). This has been developed at Lancaster University's Computer Centre by Alan Phillips. It can be downloaded from http://www.lancs.ac.uk/people/cpaap/pfe It is free software, but please read the terms of use. For those of you developing on UNIX - get something better than vi!
Please note that this site is currently under development! Development was started on the 24th of February 1999, and will be an ongoing process. Check back regularly for updates to this site.
Sign our Guestbook. View our Guestbook |
Make your contribution on our Forum Provided as a free service by Delphi. |
View our site statistics http://www.sitemeter.com |
This page last updated on 28th February 1999.