I recently had a discussion about our coding style for C# projects. Two things in particular were very hard to agree upon.
- Method Naming
C# has the de-facto standard of naming (at least public, not sure about private) methods in the PascalCase
. Coming from a Java background, our current document states to use camelCase
instead.
- Curly Bracket Placement
Visual Studio by default places every curly bracket in its own line. I don't have a source, but I can think this is also used throughout the industry as a guideline for coding style. Again, due to the Java background, our current policy is to rather write if (...) {
(same line).
When I raise these issues and non-compliance to (IMHO) standards of the C# industry, I often hear the argument "we won't use different styles for different languages, so every code looks the same".
I think this argument, while it does make sense in some way, is invalid to the discussion. Should you treat every language the same when creating a guide for your code, or use the standards of the industry around that language as a guide instead?
Unfortunately, I don't have any good counter-arguments, besides "it's what everybody else does".
What can I do to push the coding style in the (for me) "right" direction? That is towards what everybody else already does in the industry?
PS: Main languages are Java, C++, C# and JavaScript