Mike Dawson
09/06/2023, 7:06 PMian.shaun.thomas
09/06/2023, 7:11 PMOur recent guidelines on mutliplatform projects have been already nudging people to use just expect/actual functions and interfaces. You should try to avoid exect/actual classes as they are not really needed in many case. Still, if you really need them, use them. The reason we keep them experimental is that the design expect/actual is quite complicated. We don't plan to drop expect/actual classes, but as we tweak and refine their design there might be some breaking changes to your code in the future.There just isn't much reason to use expect/actual classes imo if at all given interfaces are essentially the same thing in that scenario while being quite a bit more flexible.
CRamsan
09/06/2023, 7:12 PMactual
/`expect` while also allowing for more extensibility.
I am sure it is a hard decision from the JB team to downgrade this functionality back it to experimental. But shows that at least they are willing to make the hard choices for the long term plans of the KMP project.Edoardo Luppi
09/06/2023, 7:16 PMactual
classes or objects are VERY handy.
I would not push against them just because I don't like them. More freedom equals more adoption.Edoardo Luppi
09/06/2023, 7:17 PMMike Dawson
09/06/2023, 7:19 PMEdoardo Luppi
09/06/2023, 7:21 PMcommonMain
, so each platform is forced to have an implementation.
Codecs should be singleton as they are expensive, and they should also be public and referenceable directly for an improved devexCRamsan
09/06/2023, 7:22 PMMike Dawson
09/06/2023, 7:22 PMEdoardo Luppi
09/06/2023, 7:22 PMMike Dawson
09/06/2023, 7:25 PMEdoardo Luppi
09/06/2023, 7:27 PMchr
09/06/2023, 8:02 PMException
itself: https://github.com/JetBrains/kotlin/blob/7a7d392b3470b38d42f80c896b7270678d0f95c3/libraries/stdlib/common/src/kotlin/ExceptionsH.kt#L16-L21
public expect open class Exception : Throwable {
constructor()
constructor(message: String?)
constructor(message: String?, cause: Throwable?)
constructor(cause: Throwable?)
}
Edoardo Luppi
09/06/2023, 8:05 PMCRamsan
09/06/2023, 8:08 PMPablichjenkov
09/06/2023, 8:20 PMMike Dawson
09/07/2023, 5:45 AMMike Dawson
09/07/2023, 8:47 AMGiuliopime
09/09/2023, 5:36 PMsuresh
09/11/2023, 8:26 PMNikita Bobko: An alternative for expect/actual class pair is expect fun + plain interface in the common module
Could someone provide an example of this alternative approach?Pablichjenkov
09/12/2023, 12:06 AM