Skip to content

Commit 656d51a

Browse files
committed
style-change: lambda arrow (=>) stays on the same line
After my perusal of the C# and Java style guides, I found no example of a style-guide that suggested to put the lambda arrow on the next line. Conversely, the Google Java Style Guide instructs to keep the lambda arrow on the same line, so let's go with that. I've also renamed Empty lines to Blank lines for consistency. Style guides: https://google.github.io/styleguide/csharp-style.html https://google.github.io/styleguide/javaguide.html https://github.com/twitter-archive/commons/blob/master/src/java/com/twitter/common/styleguide.md Across my perusal of
1 parent ea6d92a commit 656d51a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Docs/CodeStyle.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ For instance,
3232
```
3333
public int funcName() {
3434
if() { // No blank line because there's nothing to separate from
35-
for (;;) { // No empty line because there's not much to separate from
35+
for (;;) { // No blank line because there's not much to separate from
3636
<more calls and assignments>
3737
}
3838
39-
<more calls and assignments> // An empty line to clearly separate the code block from the rest of the code
39+
<more calls and assignments> // A blank line to clearly separate the code block from the rest of the code
4040
}
4141
42-
<more calls and assignments> // An empty line to clearly separate the code block from the rest of the code
42+
<more calls and assignments> // A blank line to clearly separate the code block from the rest of the code
4343
}
4444
45-
private void Foo() => Baz(); // An empty line between functions
45+
private void Foo() => Baz(); // A blank line between functions
4646
4747
private void One(<a long description
4848
that goes on for
4949
several lines) {
5050
51-
<more calls and assignments> // An empty line to clearly separate the definition and the start of the function
51+
<more calls and assignments> // A blank line to clearly separate the definition and the start of the function
5252
}
5353
```
5454

@@ -68,7 +68,7 @@ if (recipe.subgroup == null
6868
&& imgui.CloseDropdown()) {
6969
```
7070

71-
Most of the operators like `=>` `.` `+` `&&` go to the next line.
72-
The notable operators that stay on the same line are `=> {` and `,`.
71+
Most of the operators like `.` `+` `&&` go to the next line.
72+
The notable operators that stay on the same line are `=>`, `=> {`, and `,`.
7373

7474
The wrapping of arguments in constructors and method-definitions is up to you.

0 commit comments

Comments
 (0)