/* EGAD: STYLE_NOTES Navin Pokala and Tracy Handel Dept. of Molecular and Cell Biology University of California, Berkeley Copyright (C) 2003 Regents of the University of California GNU Public License Aug 12 2003 Absolutely no warranties are made or are implied with the use of this program or its parts. */ Some random programming style notes for EGAD. All externs are in all caps. Datatypes are in all caps or caps with lower-case prefixes. Almost all datatypes defined in structure_types.h A few .cpp files have structures which are used only within that file Variables are declared at the top of each function; no internal declarations whatsoever!! Externs are usually explicitly declared in each function they are used in. (exception for some physical constants in energy_functions.h) Local variables are <> in all caps; nearly all of them are all lowercase. (if you see something in all-caps, it's either an extern or a datatype declared in structure_types.h) Single lower case letters (especially i,j,k,p,q,n) are usually array indicies or counter-variables (int). x,y,z are usually doubles (a few exceptions, like indexing methyl group atoms for local minimization) Arrays: Arrays start at x[1], not x[0] (exception for LOOKUP_ENERGY_RESIDUE_X *lookupResX; and LOOKUP_ENERGY_ROTAMER_X *lookupRotX; in the lookup table) Array ending: The datatype definitions in structure_types.h should include array-ending flag defintions. Some common themes: Arrays of n int or double often end with x[n+1]=ENDFLAG. pdbATOM, mini_pdbATOM end w/ pdb[n+1].atom_ptr=NULL, pdb[n+1].seq_position=ENDFLAG. Datatypes that contain seq_position have arrays end with blah[n+1].seq_position=ENDFLAG. Datatypes that contain atom_ptr usually end with atom_ptr=NULL; If you're not sure where an argument is coming from, look at PROTEIN Some shorthand I use in documentation (by no means a complete list!!): "atm" = atom "bkbn" = backbone "chr" = chromosome "varpos", "var_pos" = VARIABLE_POSITION "res" = residue or resparam "rot" = rotamer "ga" = genetic algorithm "mc" = monte carlo simulated annealling "scmf" = self-consistent mean-field optimization "dee" = dead-end elimination "14", "1_4", "1,4" = interactions between atoms 3 bonds apart; torsion energy "sasa" = solvent accessible surface area "vdw" = van der Waals "ptr" = pointer