Kotlin vs Groovy

Let’s get a formal introduction to both the programming languages before we dive into the comparison section.

Groovy is a dynamic scripting language for Java platform. Groovy shows very close similarities with Java. However, safe navigation operator (?.), the concept of Closures, Traits, runtime dispatching of methods, Groovy String, Array initialization etc are a few of the Groovy features missing from Jave. If you are a Java developer, you will find the syntax to be surprisingly similar, easy to learn and less verbose.

Kotlin is a statically typed programming language which runs on JVM. It was initially developed by JetBrains and was open sourced in the year 2012. Although Kotlin shows many advancements over Java such as null safety, type inference, operator overloading etc, it lacks certain properties such as ternary operator and checked exceptions. Despite their differences, they are completely interoperable which means they can co-exist in the same application.

Both, Kotlin and Groovy are JVM languages, reduce boilerplate and are developer friendly. Let’s jump into the comparison of Groovy with Kotlin.

(more…)

Groovy String Interpolation

Groovy is a scripting language for the Java platform. Groovy provides many powerful features such as closures, type inference, runtime and compile time meta-programming and many more. In this article, we are going to have a look at String interpolation.

First of all, for those who are wondering what “interpolation” is, interpolation is the process of replacing placeholders in String literals (excluding single and triple single quoted strings) with its value.

Before jumping into interpolation feature, let’s have a quick look at mutable String objects in Groovy.

(more…)

JSON Views (Getting started with Grails 3.1 and IntelliJ)

Rumour has it that many people out there have started development with Grails 3.1. Woah!! Wait a sec, You didn’t try JSON views, right ? Believe me, you guys seriously need to know this awesome feature in Grails 3.1.  (more…)

SUBSCRIBE!

Do you want to get articles like these in your inbox?

Email *

Interested groups *
Healthtech
Business
Technical articles

Archives