Andrew Lentvorski wrote:


And I would hurt you both right off the bat for arg1, arg2.

Those better be something like:

(int transformLevel, char* blortString)

Unfortunately, this is a *classic* C failure mode. Since nobody has an editor that does autocomplete in C, everybody writes cryptic variable names.


Not everybody. I don't. :)

At my last company we implemented coding standards and made it one of our ISO documents. Part of it was 4-space indents, no tabs (spaces only). (Note: This indentation spacing was not only programmer preference, but is documented in some of the standards documents that we needed to adhere to. They all referenced the same number of spaces for indentation.) Another part was self documenting code which includes variable/argument names that describe the use and to some extent the type.

Function headers (code was in C) and file headers were mandatory and were also used in the customer API documentation as well as internal design documents. Entries into version control were to be detailed so other engineers had a clear understanding of the changes/additions made. Comments within functions were used to explain specific changes with the programmer's initials and the date of the change in cases where the change and reason for it may not be apparent.

PGA
--
Paul G. Allen, BSIT/SE
Owner, Sr. Engineer
Random Logic Consulting Services
www.randomlogic.com

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to