On Tue, 15 Mar 2022 at 11:46, Ruslan Fomkin <ruslan.fom...@gmail.com> wrote:

> …
> I support Jacek’s request to have each argument on a separate line when
> they are many and need to be placed on multiple lines. For me it takes less
> effort to grasp arguments on separate lines than when several arguments are
> combined on the same line. IMHO the root cause is having too many
> arguments, which is common issue for non-OOP languages.
>


I support this too. It has always bugged me that by having the first
parameter not on a newline, then when the method (or variable assigned)
name changes it causes all subsequent wrapped parameter lines have to be
re-indented, which leads to more noise in, and less readability of, the
patch.

For example,

method(
    "aaaaaaaaaaaaa",
    "bbbbbbbbbbbbb",
    "ccccccccccccc"
)

is better than

*method*("aaaaaaaaaaaaa",

       "bbbbbbbbbbbbb",

       "ccccccccccccc"
)

I also agree that several arguments on the one line should be avoided,
that too many method parameters is the problem here.

I would also like to suggest that an operator should always carry on
line wraps. This makes it faster to read the difference between
arguments per line wrapping, and operations over multiple lines.
For example, ensuring it looks like

var = bar == null

      ? doFoo()

      : doBar();

and not

var = bar == null ?

      doFoo() :

      doBar();

Reply via email to