DEV Community

loading...

Discussion on: What made you switch your main programming language?

Collapse
gregopet profile image
Gregor Petrin

First I have to say I don't have a real 'main' programming language; I've been exposed to programming since I was about 9 years old and I am often constrained to certain languages because they either come with the target platform or because the customer already has a working system for me to help with or take over.

That being said, my biggest professional projects were in C# and Java and I quickly came to love Groovy as a nicer way to write Java. I always liked C#, but as far as the community was concerned, the Java side was much better - nicer and more engaged people, better answers to my questions etc. The documentation and tooling is also better on the Java side IMHO so for a long time I considered Groovy to be my 'main' language. That, and by necessity Javascript, though I never had much love for it.

Then Kotlin came along and it was love at first sight. It was as if someone took the best things from C# and Groovy and fused them into a single language (and since Kotlin comes from people deeply involved with both Java and C#, I suppose it's no wonder). It has both static typing (which I love in any non-trivial project) as well as a compact syntax without relying on "magic" as Groovy or Ruby often do. IntelliJ IDEA has first class support for the language and most of Java's tooling can be used, together with its rich selection of libraries - and many Java libraries have started supporting Kotlin because it's very simple to (e.g. you can simply add a couple of methods to make Kotlin usage much nicer and while you can achieve that with Kotlin's extension methods without help from library authors, having it already done for you is the cherry on the cake).

For those parts of a project that benefit from a more dynamic language, I can still use Groovy alongside Kotlin with ease and sometimes I even paste a .java file in there, especially for code I pilfer from Stack Overflow :P

Kotlin's recent adventures in cross-platform land excite me also, primarily as a way to share "background" code between our Android and iOS apps (I'm primarily a backend developer, but with Kotlin I could also write parts that interact with the server and leave the frontend to our specialists).

So while I still program in other languages, give a free choice and if it fit the requirements, I would choose Kotlin today to start a new project in.