[Y-devel] Technical Notes

Mark Thomas mark at www.y-windows.org
Fri Feb 20 22:55:55 GMT 2004


Hi Dave,

Your comments are mostly spot on.  Most of the deviations were due to time
pressures (I had a project deadline).  A thorough linting of the source is
probably a good idea and sane patches will be welcomed.

I'll respond to a few of your comments:

> 1. Make a consistent source style.  Document it.  Don't mix tabs and
> spaces (I usually suggest 2 or 4 spaces, 8 is unwieldy).  This can be
> automated by getting CVS to launch a code formatter before entering the
> code into the repository.

The current code should conform to the GNU coding standards with the
following modifications:

   use classnameFunctionName style identifiers for functions
   use thisKindOfIdentifier for other identifiers

     - the choice between this and underscore_style is arbitrary.  I
       was finding underscores were exacerbating my wrist pains, which
       is why I chose to drop them.

   no tabs. anywhere. ever.

   spaces around the -> operator.

     - in retrospect, I think I prefer it without the spaces.  I will
       probably change this in the future.


> 2. Keep function calls commented.  This is extremely important, and even
> though it is time consuming, and nobody likes to do it (except me ;-), I
> suggest even a minimal standard (in keeping with either JavaDoc or some
> C-based documentation standard).  An example template:

I hate javadoc style in-code documentation (with cryptic @param
thingies).  But yes, functions should all be commented.


> 6. typedefs in C are the handiest things.  I can't stand pointers, and
> hate trying to read code full of 'em.

Odd, I hate stacks of typedefs.


> 12. Looping backwards to 0 is often faster than looping from 0 to a
> specific value.

That's premature optimisation :o)


Regards,

  Mark.
-- 
|| Mark Thomas
|| efaref.net
||
|| Change is inevitable, except from a vending machine.



More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved