What is the correct way to define the constant?
The studio suggests the
val can be
const , but why do we need the object which will be in the memory all the time even if it is never used?
On another hand if we write
vat STR = "some_str" each time the instance of the class is created the
STR is created again.
We can put the constant into the companion. However studio suggests to add
Companion will require more bytecode, so it seams better to use
object , which is not always needed. Also we can put it on the top level which blows up the brain because we are use to declare constants inside the class to limit the context. Here there is a constant without the scope and can also have
So we were arguing here may soon start the fight. Please answer what is the correct way to use these great tools?