Programming Notes 2
Programming Notes 2
Name of elements (variables, subprograms, function, tables, fields, queries, reports etc)
should:
- Easily be understand
- Not to be confused with other elements
- Not be meaninglessly short (e.g. N)
- Be self-descriptive
- Avoid special punctuation (which may choke some compliers)
- Avoid spaces
Remember, your source code may be used in more than one complier with different
behaviour.
Hungarian Notation
- Hungarian notation is a naming convention for program elements such as variables
and objects.
- The convention is that the first two or three letters of the element’s name indicate
the type of element.
- The rest of the name indicates its purpose, and starts with a capital letter.
- Example a text box containing a first name could be called txtFname.
CamelCase
The practise of writing multiple words as one string without spaces using capital letters to
mark the beginnings of individual words.
Styles Guides
- Naming conventions vary from programmer to programmer, and from organisation
to organisation
- Organisations often dictate local naming conventions which must be obeyed