[Geany-devel] On coding style
thomas.martitz at xxxxx
Tue Sep 8 00:28:16 UTC 2009
On 08.09.2009 01:54, Lex Trotman wrote:
> For those reading this and wondering why so much worry about coding
> style, humans are good at recognising patterns and notice divergences.
> When we are coding, debugging and maintaining code, if we are
> continually distracted by divergences from pattern due to coding
> style, we are less likely to notice the divergences due to real issues
> in the code.
> So coding style *is* important and should be machine enforced, hence I
> think Nicks script is a great idea.
I agree to all of that, except for the last part. I don't like these
scripts, since teaching programmers in the first place on a good coding
style in is the better way to enforce it. The learning curve on
project-specific style is mostly quite short, while this scripts make
programmers just careless about coding style in general (not project
specific), and might be buggy at times messing up style everywhere.
>> It seems we might need to write a clear style guide, although
>> personally I think it's pretty easy to copy the existing code style. It
>> would be quicker to read though.
> Its not always easy to determine whats important from examples of
> existing style or to correctly deduce it. For example I was *sure*
> you didn't put spaces around == and != although you did for other
> binary operators. I am not sure why I formed that conviction but
> clearly it was wrong.
That's true. There also might be totally tiny style characteristics
which you don't even notice from reading existing code.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel