https://kotlinlang.org logo
Title
l

liminal

10/25/2019, 10:25 PM
Hi all. I set out to convince my employer to start using inline classes in our android codebase while they are still experimental. Does anyone have any arguments for or against using them while they are still experimental aside from the obvious experimental status and the fact that inline classes are awesome.
n

nfrankel

10/26/2019, 8:02 AM
no argument just do it if you think it makes sense and don’t tell
l

liminal

10/26/2019, 1:48 PM
Good idea in general but not an option in my case
g

gildor

10/26/2019, 2:55 PM
Why do you want to use inline classes? Do you have particular use case?
l

liminal

10/26/2019, 2:58 PM
We have a lot of functions with primitive params that cannot be logically combined into data classes. Using inline classes should reduce room for error.
g

gildor

10/26/2019, 4:29 PM
You can use ordinary classes/data classes, performance difference may be negligatable in most cases (but not all, of course)
l

liminal

10/26/2019, 4:30 PM
That's a valid point. Is there a general feeling that you know of that inline classes will become stable in the same shape they are in now and an estimated timeline
g

gildor

10/26/2019, 4:31 PM
And on some point (when inline classes will be stable or your manager will be fine with experimental) make them inline
Most probably they will be stable, there are many experimental features already in stdlib based on inline classes
But no timeline, as usual
l

liminal

10/26/2019, 4:36 PM
Great. Can you point to an example of stdlib feature using inline classes? What do you look for to find it
Thanks @gildor
g

gildor

10/26/2019, 4:37 PM
kotlin.Result, Unsigned types, kotlin.time.Duration
💯 1