So the Google announced that Android studio would support Kotlin development out of the box, this is big news but if you don’t know what Kotlin is then it might is going to give your head slightly so basically Kotlin is a programming language and now it’s going to serve as an alternative to coding in java when you build your Android apps.
It’s a little more modern in some ways than Java and it’s probably a lot simpler for a beginner, I’m going to go over ten reasons why you should consider using Kotlin for your next app project.
1-Easy To Setup
Kotlin is super easy to set up, people have been developing apps with Kotlin for a while now using a plug-in available through Android studio but going forwards as of Android studio 3.0 starting a Kotlin project is going to be as simple as ticking a box that says “support Kotlin development”, so it’s very easy to get started and there’s really nothing stopping you from diving in and giving it a go.
2- Inter operable with Java
It’s inter operable with Java, so basically what this means is that the two languages are very similar and you can use Java commands and Java libraries in the same program that you’re developing with Kotlin so this means that there’s nothing you can’t do because you can always just fall back on Java.
3- Reduces Boilerplate
It reduces boilerplate so basically boilerplate code refers to any lines of code that need to write out lots and lots of times so it don’t really serve any purpose the function of your application. Kotlin has been designed in a way but it stops you having to do this you basically have to write a lot fewer lines and this is also partly what makes it easier for a beginner so that’s a big benefit.
4-Minimum Line of Code
The synthetic extension is an extension for Kotlin that can add to its functionality and it’s really useful basically with a single line of code at the top of your script you’re able to avoid ever having to write findViewById again, you can identify your views and then just refer to them anywhere within your code, below is an example of saving boilerplate its safety having to write hundreds of lines across the course of a big project and it’s one of my favorite advantages of using coding for development.
class MyActivity : Activity()
fun onCreate(savedInstanceState: Bundle?)
super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) // Instead of findViewById<TextView>(R.id.textView) textView.setText("Hello, world!")
5- Pick Your Own Programming Philosophy
You can pick your own programming philosophy so basically programming languages come in a variety of flavors but the two main ones are object-oriented and procedural, it’s basically changes the structure and the organization of your project and there are advantages to using object-oriented which is what Java uses but it is a little more complicated and everyone has their own preferences, basically with Kotlin you can choose how you want to structure your own project? which might make it a bit easier for a beginner and is also preferable maybe to someone who comes from a functional background, having choice is always a good thing.
6-No Null Pointer Exception
No more null pointer exceptions often referred to as the billion dollar mistake, null pointer exceptions are one of the most common errors in Java and one of the most common reasons that your apps on Android crash so Kotlin attempts to do away with this making the whole process much simpler with NULL SAFETY, basically it’s just one more way that Kotlin makes coding a little bit easier and a bit more friendly for beginners.
This might not sound like a big deal no semicolons basically in Java every line has to end with a semicolon which sounds like not a big deal but it is a lot of punctuation over the course of millions of lines and not only that but you can end up hunting to find where you’ve missed one, basically Kotlin allows you to use semicolons but it doesn’t enforce it so you won’t have that little error to worry about.
There’s no overhead to using Kotlin – so the standard library is very small and basically this means that using codes in to build your app isn’t going to make them any larger and it isn’t going to make them any slower so there’s really no downside if you do prefer Kotlin – give it a go.
9- Good Support
That’s already good support for Kotlin, so while it’s new that Android studio will support Kotlin development out of the box people have been developing Android apps with Kotlin for a while thanks to a plug-in, this means there’s already a ton of resources, forums and sample projects etc and you’re not going it alone you’re not exploring entirely new ground.
10- Good for Learning
Learning new languages is always a good thing so if you already know Java why not learn Kotlin? it’s not too different from Java I mean you can pick it up quickly and then you’ll be adding an extra string to your bow and expanding your skill set, Kotlin is also used in some server-side development, in web apps so in general it’s a useful thing to know it could help you get a job someday or it could just come in handy for personal project and there are many more benefits to using Kotlin as well, for example exceptions are unchecked and you can use lambda expressions, basically Kotlin is a slightly more modern programming language and it’s probably a bit easier like I said if you’re new to Android app development ,certainly worth trying out there’s no harm in it so give it a go.
Let me know what you think about Kotlin development and whether you’re going to be adopting it into your own workflow going forwards.