πŸ‘¨β€πŸ³ Cooking Tasty code in Kotlin 🍴 β€” Part 1

Shreyas Patil

Cooking Tasty code in Kotlin β€”β€ŠPart 1

​ Hello developers πŸ‘‹, ​ In this article, I’ll walk you through some basic recipes to cook your code tasty πŸ˜‹ in Kotlin. You’re here in the first part of this series. I’ll present some of my views in front of you and I hope you’ll like it. This article is basically for the people who are a beginner in Kotlin, want to start development in Kotlin or people who are coming from other programming languages.

I’m working with Kotlin for 2 years as of now and in these days I’m actively working with a community of Kotlin developers. In this time span, I always noticed that the community is using Kotlin but it’s not leveraging this beautiful programming language. In short, I would say β€” Developers are using Kotlin programming language syntax but they’re writing code as they’re writing code in Java😢. That’s it!. ​ Kotlin is a really easy or friendly programming language which is expressive and concise, allowing you to express your ideas with less code. This helps in reducing the amount of boilerplate code in your project and there are so many features of Kotlin which can’t be explained in a single article πŸ˜„. ​ That’s enough introduction I guess and now I think we should start talking about Kotlin. So here are some Kotlin-ish concepts which I would recommend to use in your codebase πŸ‘‡ and let’s take advantage of this superpower programming language. ​ ​

⭐️ Function

​

  • Kotlin allows us to do Object Oriented Programming as well as Functional programming. We can use it in both OO and FP styles or mix elements of the two.
  • So it’s not necessary to wrap your logic in a class unnecessarily.
  • See below code and notice difference πŸ‘‡. ​