Re: CSharp



Arne Vajhøj wrote:
Jon Skeet [C# MVP] wrote:
Arne Vajhøj <arne@xxxxxxxxxx> wrote:
How do you mean? Aren't indentation and "where you put the braces"
merely a cosmetic and personal preference in both Java and C#?
Both SUN and MS has published coding conventions.

I follow SUN coding concvention for Java and MS coding
convention for C# (unless told otherwise).

So I move the start curly brackets when I convert
code between Java and C#.

There's a lot of point in following *naming* conventions when writing
your own code, as it means it fits in well with the rest of the
framework. Brace position, however, is more of a private matter IMO.
It's good to have consistency within a project, but it makes no
difference otherwise.

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.


.



Relevant Pages

  • Re: CSharp
    ... Both SUN and MS has published coding conventions. ... I follow SUN coding concvention for Java and MS coding ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: CSharp
    ... Both SUN and MS has published coding conventions. ... I follow SUN coding concvention for Java and MS coding ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: finalize()
    ... over whether Java should support closures, ... suggestion that the conventions are useful. ... While sitting on that very ivory tower ... it is legal to call Terminator from just ...
    (comp.lang.java.programmer)
  • Would ruby be easy to code in using voice recognition?
    ... I was interested in giving ruby a try. ... I have been coding for years ... and makes coding less fun. ... For Java, I just kept getting annoyed that certain features weren't ...
    (comp.lang.ruby)
  • Re: Why C/C++ errors are SO obscure/devious??
    ... Development Environment for Java does things a little like this -suggesting at coding time what could be wrong with your code, giving alternatives on a popup textbox to change the type of your variable,. ... and although it's far too face-licking and tail-wagging for my taste I must admit it's nice to have a red squiggle appear when I call isWhiteSpace() instead of isWhitespace. ...
    (comp.lang.c)