7 ms·
if (x) { SomeMethod(paramater1, paramater2, parameter3); } You simply should not write this code. It's un
by zkldi 5y ago
if (x)
{
SomeMethod(paramater1,
paramater2,
parameter3);
}
You simply should not write this code. It's unclear, and performs nonsense indentation. You could do:
if (x)
{
SomeMethod(
paramater1,
paramater2,
parameter3
);
}
If you need your function to use line breaks.
- gregmac 5y agoI totally agree; I personally hate this style of code! However, people still write it (in the same way they screw up tabs+spaces), and in some code bases it's "the style" they use. I've also seen a lot of SQL and LINQ (C#) written in this way, as well as things like: var longString = "Line 1\n" + "Line 2\n" + "Line 3";
- zkldi 5y agoPersonally, I'd go as far to say that `alignment` is an anti-pattern. Setting up an automatic formatter and using tabs is personally the best for all worlds. Space-like alignments like var someReallyLongVar = 5; var x = 10; Are the worst!