My first reaction when Android Architecture Component is out is just **meh..** I mean come on, the ViewModel is heavily tied to Activity and Fragment and basically i don't need it because i use Conductor…
On the previous post, we already discussed how your view should have its own model. We also have discussed how you can make a simple redux-like state machine in Kotlin.
Not so long ago, on my Android's MVP architecture, my view layer does not have a model. The view only renders what the presenter tell them to do which is good because then, we have a passive view. But, there's no representation of the view itself.
Seeing FizzBuzz implementation in Clojure with clojure.core.match makes me wondering if Kotlin has the same pattern matching capabilities or at least some resemblance in the way of doing matching.
Suppose you want to test some Kotlin code, but it is too simple for you so you don't want to create a project in your IDE and it also too complex to put it in your REPL
If you're familiar with OOP then you must be familiar with constructors. A constructors is a special method of a `class` that initialize an object of that type. Simply put, a constructors is a function that return your object.
There is some code that we write everywhere. It doesn't have **state** and usually small enough to become a `class`. We often call it a helper function and in Java we used to save it in some `*Utils` class.
So we already create `Interface` in Java and convert it to lambda with in Kotlin through SAM conversion. How about `interface` in Kotlin? As the previous part suggest, currently there's no SAM conversion in Kotlin interface.
What will you do if you want to test some Kotlin syntax? Chance you are opening your favorite IDE or text editor (not mentioning `vim` or `emacs` user in here) are very likely.
Just like async/await in Javascript and C#, Kotlin Couroutines is trying to make asyncrhronous programming easier by enabling you to write async code with imperative style