This is why I am always doing like that: ``` fun b...
# codingconventions
m
This is why I am always doing like that:
Copy code
fun bestStudents(allStudents: List<Student>) = allStudents
        .sortedBy { it.grade }
        .take(10)
y
not sure what your point is. the style guide talks about 4 spaces for expression body and 4 spaces for chained call, so you won’t get the extreme indents shown in your first example. as for not wrapping immediately after the
=
sign, we discussed that and found that a small expression chunk after a long function signature is really hard to see and can obscure the meaning of the code
m
I agree that it is easy to miss first chain block after long function definition. This formatting should be good if it will be automatic
Copy code
fun bestStudents(allStudents: List<Student>) = 
    allStudents
        .sortedBy { it.grade }
        .take(10)