|
From: Xo W. <xo...@ge...> - 2010-06-25 22:34:51
|
I absolutely agree with Stephan here. Having new changes to the codebase be in a different style would be complete rubbish. What style we adopt and the specifics of styles aren't important (tabs or spaces? Really?). It's how clear the guidelines of the style are and how well the contributors stick to the style that are truly important. It doesn't matter where opening braces go; it's only well-styled code if every opening brace follows the same rule. So if we're not reformatting AGG, then we better stick to the old style all the way. I use Eclipse as my IDE, and I use the auto-formatter extensively, with different settings for each project and workspace that require it. I code in my own style and in three keystrokes my code adheres to somebody else's style. If we're going to talk style, let's talk naming and interface design. The most confusing parts of AGG to new programmers has nothing to do with indentation, but are instead its strange templated syntax and undocumented AGG-specific vocabulary. Cheers, Xo Wang ---------- Forwarded message ---------- From: Stephan Assmus <sup...@gm...> To: Anti-Grain Geometry <vec...@li...> Date: Fri, 25 Jun 2010 12:09:04 +0200 Subject: Re: [AGG] source code style On 2010-06-25 at 08:17:23 [+0200], Vinnie <th...@ya...> wrote: > > Changing an entire code base with a decent > > style to another style could also be considered a waste of > > time. > > I agree. Going through and reformatting all the source code just to conform > to some arbitrary new style is probably not the best use of time. > > However, it is the case that as new code gets contributed, or existing code > is modified, one must either try to preserve the tabbed horizontal > formatting style, change the style to conform to something new, or fuss > with their editor to get things to look right. > > Therefore I propose the following: > > - A new style is recommended for agg. Based on the feedback in other > threads on this subject, something that is boost style-like (but not > exactly) is desirable. For example, never using tabs. But maybe we don't > need to be so strict on placement of the opening brace. > > - The new style is used for all submitted new source files > > - The new style is used for code added to existing source files, with the > author having the option to reformat the entire modified source file, just > the portion they submitting, or something in between (for example, > reformatting just the function containing a change, or just the class in a > multi-class file). > > - Existing files which have not been modified will not be reformatted. This > will have the secondary beneficial effect of providing clues to the reader > for the how long its been since code was touched. Vinnie, I am sorry, but this is utter none-sense. Effectively you propose to mess up the code base with different styles, not even proposing a single new style, but "something" close to the boost style, probably up to each individual contributor. I can only guess that you simply don't want to adapt to the existing AGG style - for laziness reasons? It has been clearly expressed by pretty much everyone else that the AGG style is just fine. The only problem is that someone cannot use a proportional font. I have not heard that most AGG contributors would want to use a poportional font for editing, so given what has been said in this thread, I would think everyone could live with just leaving the style as it is. And just to confirm, the project that I am mainly contributing to uses a very different style from the AGG style, and for my own projects I use a slightly different style. For my last work project, I've had to use another completely different style and recently I've worked a lot on a WebKit port and they use yet another style. It isn't that complicated to adapt to another style and there are even tools out there that help you to make sure your code conforms before you commit. Having a consistent code base is just too valuable. If you want to know how old a piece of code is, or who contributed what, just use the versioning control system. Best regards, -Stephan |