Outside of classes, I can either declare functions as top level, or put them inside an
. Personally I really
, to me it just makes everything way more readable.
In this talk about the future of Kotlin it seems that they will address this with
The reasoning is that some people (like me) use
just to create a namespace, but don’t care creating an instance or a type of that object. To me, this just seems so perfect!
I don’t know much about how Kotlin releases, but I searched for “kotlin namespace keyword” and couldn’t find much about this topic. I was wondering when could I expect this feature to come, or if it’s any good. Are there downsides to it?