logo
logo
Sign in

Disadvantage of Kotlin : You must know before use

avatar
Geek On Java
Disadvantage of Kotlin : You must know before use

Kotlin allows you to define functions and properties at the top level of your files.

That’s a great feature, but it can cause some confusion when combined with the fact that all top level declarations are referenced unqualified from Kotlin.

This can sometimes make it difficult to tell what a function is when reading one of its usages.

If you have a function with the same name in a different package, it’s not obvious from looking at the call site which function is being called.

You can fully qualify the name of the function with the entire name of the package that it’s defined in, but given Java’s convention of very deep package names, that’s not ideal.

Recommended : Why Kotlin Anko is better than Java XML for Android?

collect
0
avatar
Geek On Java
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more