29
BoomeH
8y

I've taken over a project with legacy code, this is one of the methods:

private bool areEqual(string value1, string value2)
{
return value1 == value2;
}

Also, the opening brackets are on a new line

Comments
  • 4
    This is what happens when you pay devs by code quantity. 😁
    Anyway, that opening curly braces.. 😐😓😢
  • 0
    Assuming this is Java I'm afraid this is one of those "how has this ever worked" type of moment
  • 1
    @daarkfall It's C#, they have bools instead of booleans. But yeah, otherwise a reference comparison wouldn't be beneficial ;)
  • 5
    Isn't it common practice to place brackets on the new line? I know it is for PHP.
  • 5
    @dennie170 It's also is with the C family. That said with Java and I think Go it is common to put the opening brace on the same line as the declaration.
  • 0
  • 5
    The opening bracket is just where it's supposed to be if you follow the defacto C# standard written by Juval Löwy. To not turn this into a bracket war, I don't care where you put yours as long as you follow a standard. I chose the defacto, and it's working well for us.
  • 1
    Whats so Bad with that curly braces other than that they are useless?
  • 0
    Opening brackets are in correct position for C#. It's the whole method which is useless when we have string.Equal() and many more built-in helpers.
  • 0
    for real?
Add Comment