Kotlin & Modern Java: 17 Differences

Functional programming, null safety, observability, syntax, checked exceptions, coroutines support, data classes, type inference, extension functions, smart casts, constructors, ternary operator, primitive types, string templates, operator overloading, wildcard types vs. declaration-site variance, and cross-platform and multiplatform development .

https://digma.ai/blog/kotlin-modern-java-the-17-differences-experienced-developers-should-know/

submitted by /u/observability_geek
[link] [comments]

Continue ReadingKotlin & Modern Java: 17 Differences

Android development with kotlin for beginner

Hey anyone, I have interest in Android in the past like unlocking bootloaders, rooting, installing custom ROMs, using lots of open-source apps, etc. Now I’m thinking of pursuing my career in Android development with Kotlin. Can anyone guide me or give me roadmaps to become an Android developer? I have no prior programming knowledge, I’m an absolute beginner.

submitted by /u/ujas30
[link] [comments]

Continue ReadingAndroid development with kotlin for beginner

How prevalent is the Arrow library?

I’ve been reading a lot about Kotlin as a general-purpose language, and one of the things I didn’t like so much was exceptions and nulls.

However I found the Arrow library that adds the cherry on the cake for me, it feels Scala-esque and looks very powerful too.

How widespread is its use in Kotlin? Is it a niche library? Does it pollute APIs with its custom types? How people get deal with nullability and error handling otherwise (or do you just accept try-catch)?

submitted by /u/lekkerwafel
[link] [comments]

Continue ReadingHow prevalent is the Arrow library?

val peripheralScope = CoroutineScope(Job())

Hi,

This is from https://github.com/JuulLabs/sensortag example (Android, Bluetooth BLE). The subj is the entire content of sensortag/app/src/androidMain/kotlin/CoroutineScopes.kt. There’s another file, sensortag/app/src/commonMain/kotlin/CoroutineScope.kt:

fun CoroutineScope.childScope() =

CoroutineScope(coroutineContext + Job(coroutineContext[Job]))

fun CoroutineScope.cancelChildren(

cause: CancellationException? = null

) = coroutineContext[Job]?.cancelChildren(cause)

While I’ve read the Kotlin docs about Coroutine and Job and the ideas seem understandable, this particular usage is still puzzling for me. What’s the real meaning of these declarations?

submitted by /u/AwkwardNumber7584
[link] [comments]

Continue Readingval peripheralScope = CoroutineScope(Job())

End of content

No more pages to load