Choosing a Programming Language


Android Architecture Simplified with Kotlin

I hate Android Architecture since it is based on OO Java, Kotlin is FP cousin of Java, hopefully it could simplify the Android Architecture by getting rid of the complex OO architecture. Here Antonio attempts to simplify it with more terse Kotlin codes, albeit still in the OO architecture spirit.

Kotlin: Co-Variance, Contra-Variance, Invariance, Immutability

Kotlin is a functional programming (FP) language which has the Category concept of co-Variance, contra-Variance. Java is object-oriented not FP, it has only Invariance.


Covariance and contravariance are terms that refer to the ability to use a less derived (less specific = CoVariance eg. Apple instead of Fruit) or more derived type (more specific = ContraVariance, eg. Gala instead of Apple) than originally specified.

Generic type parameters support covariance and contravariance to provide greater flexibility in assigning and using generic types.

  • Invariance

    Means that you can use only the type originally specified; so an invariant generic type parameter is neither covariant nor contravariant. (Java is always invariance.)

Learn Kotlin sans Java

Kotlin is Object-Oriented Java + Functional Programming.

Much as we hate Java, Kotlin can’t run away from the Java “ghost” especially in Android development using the Java API and OO design patterns.

This tutorial, however, teaches you Kotlin “sans Java“, a great news for novices without Java knowledge.

I like this Kotlin teaching approach for 2 reasons:

  1. No need to struggle with Java /Android OO architecture until later stage;
  2. No need to be intimated by the complicated “Android Studio” editor.