Code#1 : What the Heck is Kotlin ???
Programming is that type of Daily Soap on Indian TV, which can change/update at any time of the day or any day of the year !!!
So, you have to be super ready as a developer to adapt any new language introduced in your field. And this time its for Android Developers and the freshly baked language for them is, none other than Kotlin.
Lets go through some of the things that you as a developer needs to keep in mind while even moving towards trying this new stuff.
0) What is Kotlin?
The Super Important Question Right Now!!!
Kotlin is an Android-compatible language that is concise, expressive, and designed to be type- and null-safe. It works with the Java language seamlessly, so it makes it easy for developers who love the Java language to keep using it but also incrementally add Kotlin code and leverage Kotlin libraries. Also, many Android developers have already found that Kotlin makes development faster and more fun, so we want to better support these Kotlin users.
1) Why prefer Kotlin over Java?
You should prefer Kotlin over Java!!! No, its not like that. But you should be clear and precised about WHY. This bold thing “WHY” can make your life easier if you continue to raise it before doing or implementing anything.
Q. Why Kotlin?
A. Basically Kotlin offers something which Java does not provide you from years of its existence. But I think this is the Job of new and different languages to come up with something that the previous or current languages does not offer.
Here Kotlin offers or you can say fixes some of the issues of Java, like
- Null references are controlled by the type system.
- No raw types
- Arrays in Kotlin are invariant
- Kotlin has proper function types, as opposed to Java’s SAM-conversions
- Use-site variance without wildcards
- Kotlin does not have checked exceptions
2) What I have to do to get a sneak peek into Kotlin?
Just Follow these Steps
So the pivot of all the discussion comes to this basic point, that HOW can i get some of the Kotlin in my Environment and have some basic knowledge of it.
The Easiest way I know is this:
Step 1: Open Android Studio, Go to File -> Settings -> Plugins.
Step 2: In Plugin Section, look at the bottom section and click that “Install JetBrains plugin…” button.
Step 3: Now Search “Kotlin” or Scroll down to the letter ‘k’ and find “Kotlin” there and hit that Green Install button and let Studio do the downloading part.
Step 4: Wait…Wait…till it finishes.
Step 5: Now create a New Activity in your Android Studio and open MainActivity.java File.
Step 6: With the help of some keys of your keyboard, press Ctrl+Alt+Shift+K and it will show one dialog which says — “Convert Java Files into Kotlin” and hit OK.
Step 7: Kaboom!!! Welcome to the Kotlin and its MainActivity.kt File.
And don’t forget to collect some cashback for you to being the part of this Kudos Tutorial -
Here are some ultimate resources and links to move further in Kotlin and its environment before actually getting into the business end of it:
This is our sincere endeavor to aware developers about the latest things that they can get and they can implement if and only if they become Super Aware and read our Cool Blogs.
Gently Hit that Green Heart and Recommend to your friends, colleagues and mates.
Kudoss to Android,Java and Kotlin