This message was deleted.
# getting-started
s
This message was deleted.
s
Depends on the context. Are the constants only used within
FooX
? Are the constants directly related to the class? There’s no right answer, it ultimately depends on where you think the best placement for them is
If the constants are only applicable to
FooX
, then I would put them in the companion object. If there are other functions/properties/classes in the file that use them, I would put them on the top-level
Then companion object
Personally, I wouldn’t worry too much about generated bytecode like this, especially when it comes down to a few lines
m
And in kotlin code, the constants get inlined by the compiler regardless of how they're defined.