<https://blog.shreyaspatil.dev/runtime-surprise-ko...
# feed
e
yes there is a whole set of issues around initialization, https://youtrack.jetbrains.com/issues?q=tag:%20use-before-initialization
s
yeah
b
It's not Kotlin specific, you can get same error in plain Java.
Copy code
public class Example
{
    Boolean value1 = computeValue1();
    String value2 = getData();
    Boolean computeValue1() {
        return value2.isEmpty();
    }
    static String getData() {
        return "SomeData";
    }
    public static void main(String[] args) {
        new Example();
    }
}
So Kotlin "breaks" nothing
s
In java, null-safety is not there. So it’s natural in Java But let’s say in kotlin
Copy code
val something: Type
something
is val declared as Non nullable type, so it becomes tricky to identify such issues in code review or debugging.