Kotlin, first steps! Part. 1

in #kotlin6 years ago

Hello Steemers!!!

Today we are going to start talking a little more about Kotlin, but I will not talk about it, we will talk about other languages.

The Kotlin language was developed by JetBrains, famous for its IDE's (RubyMine, IntelliJ, PhpStorm, etc.), built for internal use by the company and designed for readability, productivity, and limitations that JetBrains faced with Java, this happened after evaluating the languages that run in the JVM, so JetBrains decided to write its own linaguagem, to Kotlin. Its objective was the improvement of its products, much attention was given to interoperability with Java language.

Interoperability
One of the main features of language is the focus on interoperability, so you can easily call Java code in your Kotlin code and vice versa. This is certainly one of the most interesting features, since it will not be necessary to migrate from one language to another drastically.

Null Safety
Have you ever had a problem while handling a NullPointerException, who ever? Kotlin's type system distinguishes references that may or may not be null:

var name: String = "Kotlin"
name = null // error

var name: String? = "Kotlin"
name = null // is ok!

Note that in type String com? can be assigned a null value, and we can make secure calls:

name?.length

If name for null the length method call will not be made, but we can also force this call:

name!!.length

Thus, if name for null we have an explicit exception that should be treated.

-------<>-------|-------<>-------|-------<>-------

It's just for today. See you next time.

Github

Another way to learn a programming language for sure is to see open source codes and with the absolute certainty Github is the perfect place, now go to the link below:

https://github.com/topics/kotlin

Sort:  

Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!

Reply !stop to disable the comment. Thanks!