From the style guide:
- For multiline function signatures, each new line should align with the first parameter. Multiple parameters per line are permitted:
fn frobnicate(a: Bar, b: Bar, c: Bar, d: Bar) -> Bar { ... } fn foo<T: This, U: That>( a: Bar, b: Bar) -> Baz { ... }
I really don't think this is a good idea. It's quite hard to skim the code when everything is indented differently, and it gets especially unreadable as function names get longer. It also makes diffs unnecessarily large, since you need to reindent pretty much every time you rename the function. As a general rule, I don't think that variable leading indentation is a good idea, but especially so in this case. The guide has a question about whether this should also be allowed:
[OPEN] Do we also want to allow the following?
frobnicate( arg1, arg2, arg3)
This style could ease the conflict between line length and functions with many parameters (or long method chains).
I'm of the opinion that this should actually be the preferred formatting. What's the reasoning behind the current guideline?