* Case & Style
@ 1986-12-31 7:37 larry
0 siblings, 0 replies; only message in thread
From: larry @ 1986-12-31 7:37 UTC (permalink / raw)
--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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1986-12-31 7:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1986-12-31 7:37 Case & Style larry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox