DEV Community


Posted on • Updated on

The niche guy writing


I worked with Spring + Java for a while but I changed a lot of jobs in 6 years of development and I was always treated more like "Jack of all trades master of none". Not that it's not true as I worked with Java, C#, ColdFusion, PHP, NodeJS + fronted stuff like AngularJS, vanilla JS, React, and if that's not enough had some experience setting up dev servers with Debian, Apache, mail server... Enough of naming stuff! I heard about Groovy but never had time to learn yet another thing I'm not going to be good at. So in 2017 when I got back on track with JVM and started working again with Java I had discussions with work colleagues and watch webinars, read articles about JVM stuff. Heard and liked a lot of thing about Scala and Kotlin but thought Kotlin was mainly hype and it's going to be best used on Android.

A bit more

After a while got a job interview for Java developer but they told me they're switching to Kotlin on new APIs. Even though I never really cared about better C# for JVM :D, I wanted to learn something which is going to be in use and stick with it. Scala was a bit too hard and too niche and you had to know FP + OOP good and be really smart to get into projects/companies that use it as it was mainly used on high scale projects or big data processing. So I took a job in .NET Core and boy was I disappointed with the framework comming from Spring background. In spare time I played with Micronaut and I think it's amazing. Now knowing about Grails and GORM I thought why not build more APIs with Groovy since it's easier and faster to write in than Java, and why do we even need Kotlin except to replace Java since too many people hate it?

The rhetoric questions

Couple of days ago I saw Groovy being #20th on the TIOBE index and Kotlin #35. Today, 11.04.2019 (04.11 in US :D) it's still the same. So I started wondering about Groovy. Is it gaining popularity because of Micronaut as most examples are combination Java + Groovy where Groovy is mainly used with spock examples for testing? Is Kotlin getting pushed by it or is it loosing battle in mobile world were we can expect Flutter, Dart, Xamarin to replace it?

Now Scala is not for replacing Java as it's not so compatible with existing frameworks for Java and it requires a lot of tuning to use it like that. Instead it has it's own purpose and frameworks. Groovy is like easy language for JVM. It has less strict rules than Java and frameworks like GORM do a lot of nice stuff so you have to type less.

On the other hand there's GraalVM. It allows devs to write a lot of stuff in different languages and connect them easily - at least that's what their aiming for. So what will be the effect on JVM?


Just wanted to get some opinions. Please to inform me about my poor writing skills as this is my first blog post so I can update this poem.

Discussion (2)

_hs_ profile image
HS Author • Edited on

I agree.

Personally I love annotations for a lot of stuff. Currently I work as .NET Core and there you need to write something like services.AddScoped() which makes no sense as they have [Controller] annotation. Why not give [Service(scope)]. Also I love that Spring is mainly Singleton style for most stuff at least on projects I worked for like Controllers, Services, Repository. In .NET Core you need to realy think hard before using singleton as most are scoped which in spring is Request scope if I remember correctly. Also forget about @Repository and implements JpaRepository because in C# you have DbContext and try to get your head around it first week you switch from Spring. But all of this is about framework. As a language I do miss some stuff in it.

I love checked exceptions as they make me feel safer and less testing is required but I do miss ?. and ?? from C# in Java. I also miss something like initializing object and filling stuff like in C# new Stuff { a = "", b = 5...} forgot what this is called. When it comes to LINQ I like streams better. I do however still miss anonymous type while using streams. In LINQ C# you can do list.Select(x => new { Att = "", Att2 = 1}) while in java 11 it's still not that simple.

However I like Java and hope to see it get more features/syntactic sugar, but on projects that don't require too much performance why would I not now skip some stuff and use Groovy since it's faster to work with. For example you need quick small API for just simple CRUD and need to use JVM for some reason. Especially with Micronaut out, I'm more excited about it than any other thing recently.