https://kotlinlang.org/docs/coding-conventions.html#class-headers says “Classes with a few primary constructor parameters can be written in a single line”. is there really no recommended way? (I think if theres for example only one parameter it should always be a single line)
r
reevn
08/24/2021, 3:23 PM
Does it matter if it says can or must? Seems pretty straightforward to me: If it fits neatly into one line, put it into one line. If it does not, split it up line-by-line
c
christophsturm
08/24/2021, 3:52 PM
I was just wondering if its a “do what you want”- can, or a “you really should”- can
christophsturm
08/24/2021, 3:56 PM
i read the can as “should”. my coworkers read it as “its perfectly fine to write
Copy code
class Blah(
val b: String
) : Interface
”
h
hho
08/24/2021, 6:02 PM
my coworkers like to do that, too. and not just for classes…