I wonder about coding conventions - the class layo...
# getting-started
i
I wonder about coding conventions - the class layout:
Copy code
The contents of a class should go in the following order:

Property declarations and initializer blocks

Secondary constructors

Method declarations

Companion object
What would be the reasoning of placing companion object at the end? (just personal style, or there is some actual argument behind it?)
p
I guess it's because it's least touched / remains constant mostly.
m
I was wondering the same thing about
companion object
but it didn’t cross my mind to ask here 😄 and it’s good idea I used to put it first, above everything
@pavi2410 makes sense. in Java for example statics are defined first, on the very top of the class tho 😕 🤔
p
Must be a Kotlin-thing as syntax could influence on the position. I put `const val`s at the very top too.