Naam: Sander Verbruggen
Huidige functie: Java Developer/Architect
In this series of posts I want to show you how Kotlin improved on the Java language, without going into too much of the added features. Just the features that enhance your (existing) Java code.
It is intended for Java developers who want to make their code
- More readable
- Less redundant
- Still Java-compatible
Therefor making you (and the people working with your code after you!) more productive.
My experience
I introduced Kotlin at the start of my last project and began by modeling our domain classes in Kotlin. Later on we grew more confident in the use of Kotlin and found ways to put it to use in more functional classes like services, builders and test helpers.
When I left the project team after 2.5 years members agreed with me that Kotlin greatly improved the code and that they would take this to other projects as well. I will too of course, using the posts in this series as proof/inspiration.
How to read
Introduce Kotlin to your team
This series is, I think, an easy introduction to Kotlin for the intermediate Java developer. Read the posts listed below, look at the examples and start using it at a scale you’re comfortable with.
If you want to introduce Kotlin to your team or project, don’t go overboard and go 100% Kotlin for your next project. Read these three posts and start using it right away!
- Read the Kotlin essentials for some key concepts in the Kotlin syntax.
- Write domain classes in Kotlin. Mostly simple classes like
Address
,Person
,User
etc. - Integrate it with your (current) Java project.
This is enough to use Kotlin in your (existing) project!
Next steps
These posts tell you about more advanced features of Kotlin, but still within the ‘boundaries’ of this series.
- Inline functions. It’s a small topic, but I love it.
- Streams. Like the Java streams but again just essential code. That is a more elaborate topic.
At that point I would suggest diving into the Kotlin language for real. Take a course, buy a book and of course follow my blog; I will post some examples how we used Kotlin for services, unit tests, builders in the future.
Alternative: Project Lombok
A lot of what you will see in the first post (Kotlin classes) can also be achieved by using Project Lombok. We’ve actually considered Lombok for our project and decided against it, because Lombok is mostly that: enhanced Java classes by annotation. From my experience, Kotlin is so much richer and let’s you write beautiful code, not just annotate it. No hard feelings if you decide to go with Lombok, but know that you’ll be missing out on the inline functions and streams.
Gerelateerde vacatures
Gerelateerde blog posts
Dit is het verschil tussen een software engineer en een computer scientist
Deze blog is voor jou wanneer jij werkzaam bent als IT’er in de softwarebranche, maar het nog steeds lastig vindt om het precieze verschil tussen een software engineer en een computer scientist te identificeren.
5 manieren om jouw kennis als software developer te testen
Als software developer is het van cruciaal belang om voortdurend je kennis en vaardigheden op het gebied van programmeren te testen en te verbeteren. Lees snel de blog om erachter te komen hoe je jouw skills op de proef kunt stellen!
De 7 voordelen die jij meebrengt als een full stack developer
Als developer beschik je over een unieke kracht om de Nederlandse maatschappij vorm te geven en positieve veranderingen teweeg te brengen. Benieuwd hoe? Lees deze blog!