CSharp

  • Thread starter Thread starter Mark Campbell
  • Start date Start date
Arne said:
It is not particular funny for maintenance programmers if
half the code uses K&R and the other half Allman.

Which I believe is why Jon said "Within a project".

Today's IDEs make it simple enough to make brace style, indenting, etc.
consistent within a file. Unfortunately, the weird disconnect that exists
between IDEs, which know enough about language syntax to make reformatting,
renaming variables, etc a snap, and SCM systems, which know nothing but
lines and bytes in lines [1] means that this sort of reformatting can
introduce many spurious diffs that obfuscate the history of the file.

1. And in many cases, even treat CR vs. CRLF line-termination as a
significant difference.
 
Mike said:
Which I believe is why Jon said "Within a project".

Is it unusual with 1 project, >1 developer and 1 maintainer ?

Arne
 
Arne Vajhøj said:
Is it unusual with 1 project, >1 developer and 1 maintainer ?

No - which is why I said it's important to be consistent within a
project. All the developers and maintainers within a project should use
the same bracing style, but so long as they agree, it doesn't matter
too much what it is.
 
Jon said:
No - which is why I said it's important to be consistent within a
project. All the developers and maintainers within a project should use
the same bracing style, but so long as they agree, it doesn't matter
too much what it is.

Assuming that maintenance programmers does not have to switch
between projects ...

Arne
 
Arne Vajhøj said:
Assuming that maintenance programmers does not have to switch
between projects ...

If they have to change *often* (an occasional change isn't too hard to
cope with) then the company should certainly standardise on one way or
the other - it would generally be a good idea to do so anyway.

However, my main point was that the style used isn't visible to
external code, and while I believe that a thorough study would show K&R
to be harder to get used to, I don't believe there's sufficient
difference to try to impose one style on *everyone*. Compare that with
naming conventions, where it's useful for everyone to use the same
conventions for one platform.
 
Jon said:
If they have to change *often* (an occasional change isn't too hard to
cope with) then the company should certainly standardise on one way or
the other - it would generally be a good idea to do so anyway.

However, my main point was that the style used isn't visible to
external code, and while I believe that a thorough study would show K&R
to be harder to get used to, I don't believe there's sufficient
difference to try to impose one style on *everyone*.

I do. I does not really cost much in effort. And it prepares
better for future code and project changes.

"One Coding Convention to rule them all"

:-)

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top