a3ef3c95bc7b21a5c2867c18261215929f3c651e kent Wed Oct 5 14:40:50 2016 -0700 Adding bits about global naming convention. diff --git src/README src/README index 782ef05..3b47ea3 100644 --- src/README +++ src/README @@ -109,30 +109,34 @@ only the first letter is capitalized. genscanTabSeparatedFile -> genscanTsf Numbers are considered words. You would represent "chromosome 22 annotations" as "chromosome22Annotations" or "chr22Ann." Note the capitalized 'A" after the 22. Since both numbers and single letter words (or abbreviations) disrupt the visual flow of the word separation by capitalization, it is better to avoid these except at the end of the name. These naming rules apply to variables, constants, functions, fields, and structures. They generally are used for file names, database tables, database columns, and C macros as well, though there is a bit less consistency there in the existing code base. +Variables that are global should begin with the small letter "g." This +is a relatively recent convention, and is not so widely used, but when +maintaining code or writing new code it would be good to adopt it. + ERROR HANDLING AND MEMORY ALLOCATION Another convention is that errors are reported at a fairly low level, and the programs simply print an error message and abort using errAbort. If you need to catch errors underneath you see the file errAbort.h and install an "abort handler". Memory is generally allocated through "needMem" (which aborts on failure to allocate) and the macros "AllocVar" and "AllocArray". This memory is initially set to zero, and the programs very much depend on this fact. COMMENTING