[comp.lang.ada] Case & Style

larry@JPL-VLSI.ARPA (12/31/86)

--Sorry about the PC message.  I sent it the 5th & it only now got out!

Since Ada doesn't distinguish case unless it's in a char/string literal, 
it's easy to write code in a way that suits you and convert it with a 
utility program to whatever your boss/client wants.  For me upper-casing 
keywords was handy when learning Ada but got in the way afterward.

I found indentation plus placement of keywords was all I needed to easily 
see program structures.  (Later I got hold of an editor with an overview 
feature like some of the outlining word-processors.  Now placing the cursor 
and hitting one of two escape sequences folds and unfolds a program very 
quickly so I can see different structural views of it.)

The casing scheme I use now is based on a linguistic principle.  In natural 
language frequently used tokens are typically short and de-emphasized 
because our minds need very little to discriminate and handle them.  The 
less frequent tokens have to be longer and use various emphasis devices.

I decided that I needed to focus most on data and so use all caps for type, 
constant, and variable references.  References to executables (subprograms, 
tasks and entrys, block labels, exceptions, packages) use caps only for the 
first letter in each reference and after each underline.

This is essentially what Karl VanNeste recommended in his Ada Letters 
article (Jan-Feb '86, "Ada Coding Standards and Conventions").  However, I 
don't consider this the ONE RIGHT WAY.  Someone else, especially if writing 
programs very different from the kind I do, might need a different 
convention.