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 π. β