First Impression of Jetpack Compose, QoL Issues

Getting Started

1. Function should start with a lowercase letter

Immediately you can see lint warning on every single Composable function. Typically functions are supposed to start with a lower case letter however Composable functions break that norm and seem like they should start with an uppercase letter.

2. Latest version of Kotlin not supported

Android Studio templates have always been kinda bad, so I checked build.gradle and tried to update the dependencies and language version. And to my surprise, the latest version of Kotlin is not supported.

3. Type `TypeVariable(T)` has no method getValue

I have a long history in Android, but coming into Jetpack Compose I feel like a complete beginner again. My immediate goal is to make a counter on the screen that increments once per second. But we don’t have a modifiable TextView, just a Text function with no return. This is a big paradigm shift.

var counterState = mutableStateOf(0)

@Composable
fun Counter() {
val counter by remember { counterState }
Text(text = "Count: $counter")
}
// Can auto-import
import androidx.compose.runtime.remember
// You have to manually add these two
import androidx.compose.runtime.getValue // Needed for val and var
import androidx.compose.runtime.setValue // Only needed for var

In Conclusion,

My Day 1 impression after hearing about Compose for more than a couple years now was pretty bad. Hopefully these issues can be fixed. The strict Kotlin version requirement is a major issue in my opinion, the other two are annoyances but won’t stop you from using Compose if you want.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store