You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/KEEP-0439-named-only-parameters.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ fun reformat(
62
62
When it is called without argument names, for example `reformat(myStr, true, false, true, ' ')`, it's difficult to say for the reader what the meaning of its arguments is.
63
63
64
64
That's why developers always try to remember to specify the argument names in such cases.
65
-
[Kotlin coding conventions](https://kotlinlang.org/docs/coding-conventions.html#named-arguments) also recommend to use named arguments named argument syntax when a method takes multiple parameters of the same primitive type, or for parameters of `Boolean` type.
65
+
[Kotlin coding conventions](https://kotlinlang.org/docs/coding-conventions.html#named-arguments) also recommend to use named arguments syntax when a method takes multiple parameters of the same primitive type, or for parameters of `Boolean` type.
66
66
67
67
In Java, it's also a common practice to specify argument names in the comments, e.g. `reformat(myStr, /* normalizeCase = */ true)`.
68
68
This is a clear sign that argument names can sometimes play a critical role in code readability.
0 commit comments