Hi everyone at the community of this awesome language!
I’m currently developing a game. There, you have to be careful not to create any instances after the loading screen is over and the game running. Otherwise, the GC may produce tiny lacks which prevent a smooth gaming experience. Therefore, I make use of object pools.
In some cases, Kotlin creates a lot instances at runtime, especially for closures. Sometimes even for IntRanges. Sometimes it doesn’t. I just want to know, how I can know how a piece of code will behave in advance.
So far I found out, it’s not a good idea to capture member variables. Are there any other rules?
Or are the rules changing a lot while Kotlin is developed. I have the feeling, that I had less trouble with 1.0.0-beta-2xxx (I’m using 3xxx now).