On 3/30/09 1:00 AM, "Paul McCullagh" <[email protected]> wrote:

> 
>> Style #4:
>> 
>> Have a style you prefer? :)
> 
> It is ugly, but it really is the best method!
> 
> Prefix class variables with a unique prefix. For example:
> 
> class Diagnostics_area
> {
> ...
>   /** Message buffer. Can be used by OK or ERROR status. */
>   char da_buffer[DRIZZLE_ERRMSG_SIZE];
> ...
> }
> 
> This helps you find all reference to this variable in the entire
> program. In the example above you can quickly find all usages of the
> Diagnostics_area buffer (as apposed to 100s of buffers in other
> classes and structures).
> 
> I have some experience with this, and I can confirm that, when fixing
> a bug, or just trying to understand the code (even your own code), it
> is _EXTREMELY_ useful.
> 

As an example of the usefulness of this convention just think of the number
of times you had to track down the uses of a field called something like
'flags' and how much fun that was.
 
-------------------------------------------------------------------------
Barry Leslie

SNAP Innovation Softwareentwicklung GmbH
Senior Software Engineer

Tel: (001) 250 595 4228
Fax: (001) 250 595 4233
Email: [email protected]
Web: www.PrimeBase.com

SNAP Innovation Softwareentwicklung GmbH, D-22765 Hamburg,
Max-Brauer-Allee 50, Germany
Amtsgericht Hamburg HRB 61066, Geschäftsführer: Ulrich Zimmer, Paul
McCullagh
-------------------------------------------------------------------------




_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to