



If you’ve been reading this series of articles about Kotlin, you’ve probably seen it crystal clear many times. #Kotlin is a mature language, been through several years of alphas and betas until its final release. And that even before the beta came out, there were people using it in real projects. It’s interesting to know that before its final version, the language spent several years in alpha and then in beta. Therefore, working with Kotlin is awesome in that sense. The IDE plugin works smoothly, and already allows many of the features that you love and use in Java. This means that there are hardly any problems when working with Kotlin, everything works as you would expect. Unlike other languages like Swift, the Kotlin release has gone through many stages before releasing the final 1.0 release. Here are my reasons why I think that moving to #Kotlin is one of the best things you can do. Here are my reasons why I think that, far from being a risky bet, moving to Kotlin is one of the best things you can do. Java has proved to be working during all these years, so why should you change? Let’s start with Java version, so we can better understand how those Kotlin functions can help us write more concise and readable code at the same time as well.Even now that Kotlin is an officially supported language to write Android Apps, you may still feel that there are not enough reasons for a change. Nothing is better than real code snippets, right? block in also() and let() is is a function that takes in T as the argument, but in others it is an extension function on type T.apply() and also() return T, but others return R.Since it’s the last argument, so Kotlin allows you move the function declaration out of the method parenthesis. The last argument is a function that you can supply to operate the receiver object.Even though with() is not an extension method, the instance of T is still called receiver in method definition. T is the type of instance you want to operate with, and in Kotlin’s terminology it is called receiver type.Instead let’s read through the method signatures “literally” and look for things that are the same and ones that are different. If you try to read the comments, it’s very difficult to understand the differences immediately. let ( block : ( T ) -> R ): R = block ( this ) * Calls the specified function with `this` value as its argument and returns its result. * Calls the specified function with `this` value as its receiver and returns `this` value. */ public inline fun with ( receiver : T, block : T. * Calls the specified function with the given as its receiver and returns its result. * Calls the specified function with `this` value as its receiver and returns its result.
