Re: enforcing coding style
2003-03-01 01:45:17 GMT
----- Original Message -----From: Michael PohoreskiSent: Saturday, March 01, 2003 6:22 AMSubject: RE: [Sweng-gamedev] enforcing coding style
I disagree that enforcing a code standard is a Bad Idea. I was against a coding standard at first, but after have using one for a few years, I love it. Have a *consistent* coding style most certainly is MUCH better then "everyone doing their own thing with every file using a different standard."
If people don't "buy into" a standard, they won't use it. What we found to work reasonable well, was to come up with a common coding standards where everyone was allowed to contribute their ideas and preferences. We then had everyone (mostly) agree upon what style they would like -- with our Chief Architect as arbitrator -- since he had written more code then any one of us. This way, most people will follow the standards most of the time, if they don't have to make too many changes to adapt to the new style.
We also have a doc++ macro that "enforces" a standard as well. Spend a day getting it written - you will find it to be very helpful over the years.
Even if your coding standard is as simple as agreement(s) on:
- Comment blocks & Function line separators
- naming practices, for globals, pointers, statics, templates, enums.
i.e. p for pointers, s for statics, _ for member variables, etc. (Yes, a slight use of Hungarian Notation makes things more readable, not overzealous use which is overly complicated and cluttered.)
- Bracket placement
- White space, and alignment
- Tab size
If someone has issues following something as simple as standard coding practises, are they actually helping the team in the long run?
From: J C Lawrence [mailto:claw <at> kanga.nu]
Sent: Friday, February 28, 2003 1:03 PM
To: sweng-gamedev <at> midnightryder.com
Cc: sweng-gamedev-midnightryder.com <at> lists.midnightryder.com
Subject: Re: [Sweng-gamedev] enforcing coding style
On Fri, 28 Feb 2003 10:27:39 -0500
Eric Preisz <epreisz <at> d-a-s.com> wrote:
> Enforcing coding style is quite an arduous task when forcing coders to
> conform to a style doc. Maybe Castro could do it, but I'm not much of
> a dictator.
Then don't. Period. Bad Idea with very few to no gains.