[asterisk-dev] Coding guidelines change (proposed)

Steven S. Critchfield critch at basesys.com
Wed Feb 27 14:10:48 CST 2008


----- "Daniel Hazelbaker" <daniel at highdesertchurch.com> wrote:
> On Feb 27, 2008, at 8:28 AM, Atis Lezdins wrote:
> 
> > On 2/26/08, Tilghman Lesher <tilghman at mail.jeffandtilghman.com>
> wrote:
> >> I'd like to change the coding guidelines that the braces are no  
> >> longer
> >> optional; that they are mandatory, and if this change is approved, 
> 
> >> a janitor
> >> project will be posted shortly to convert legacy code to the new  
> >> standard.
> >
> > -1 for janitor
> 
> Not that I am volunteering, but with all the -1's on the janitor  
> project, what about a janitor project that is more general in scope?  
> 
> Aside from the { } issues there (as has been pointed out) indentation 
> 
> issues and (IMHO) some pretty massive documentation issues where we  
> have 100+ lines of code in a function without any comments inside the 
> 
> function. In many places I have trouble even finding the comment  
> because it is so short it looks like another line of code.
> 
> To help keep the possibility of (massive) problems down from  
> accidently messing up some code it could be done in small chunks. Say 
> 
> 4 or 5 files at a time (certain files, like voicemail, should probably
>  
> be done by themselves as they are just too massive alone).  I think  
> with the new release candidates we could minimize the possibility of 
> 
> introducing new bugs as long as we take small bites.

Maybe it is me, but just because you commit in smaller chunks doesn't reduce the chance of error. It just reduced the amount of reverting to reverse the commit.

Breaking those long functions up might be a good idea. Commenting is always a good idea, but commenting isn't a janitor project. At least not in my opinion of what janitor projects are meant to do. Janitor projects are nearly mindless code changes. Commenting requires knowledge of what is going on unless you want someone commenting on the obvious.

-- 
Steven Critchfield critch at basesys.com



More information about the asterisk-dev mailing list