this post was submitted on 08 Jul 2023
51 points (98.1% liked)

Programming

17507 readers
9 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

I've been learning Kotlin recently & I find it to be a beautiful Language. Does anyone at work use Kotlin that isn't an Android developer?

all 20 comments
sorted by: hot top controversial new old
[–] RandomDevOpsDude 10 points 1 year ago* (last edited 1 year ago) (1 children)

Yes, I write SpringBoot microservices and IntelliJ plugins using Kotlin. Any new code is Kotlin, but there is still a ton of Java, which I don't consider "legacy", since it works, and if I can sanely add Kotlin when necessary, I don't see the need for "full rewrite".

You may get more traction by asking the Kotlin community

[–] Von_Broheim 6 points 1 year ago* (last edited 1 year ago) (1 children)

Legacy code is just code inherited from developers that are no longer around. It's quality has nothing to do with its age.

[–] austin 2 points 1 year ago

the developers don't have to of left the team to make it legacy code

[–] snowe 7 points 1 year ago

I've been using it server side (haven't touched android for ~12 years) for almost 7 years now. It's fantastic.

[–] [email protected] 6 points 1 year ago

I retired now, but I still write code for my blog. I totally prefer to write with Kotlin. Java just feels clunky to me now.

[–] [email protected] 5 points 1 year ago

Last job, we started writing mixing bits of Kotlin in an otherwise mostly-Java in a monolithic Spring-based service. Good experience.

[–] [email protected] 4 points 1 year ago

My company moved to Kotlin completely, only legacy projects have some Java left.

[–] balder1993 4 points 1 year ago

I have friends who work at the biggest bank in Latin America, where most backend stuff used to be Java. Nowadays all new code is written in Kotlin.

[–] lorefnon 3 points 1 year ago

I don't use it right now, but two years ago I helped a team incrementally adopt Kotlin in a ten year old java/spring/mybatis codebase. We didn't have any android experience and in the initial few months mostly used kotlin as a better java, avoiding features that would prevent us from switching back to java if needed.

But it worked pretty well - we didn't face much resistence from people experienced with java because they could still continue to benefit from their jvm familiarity, and the language was approachable to new folks who joined us. It also helped that we could just copy paste java code into a .kt file and intellij would convert it to kotlin.

We didn't venture into kotlin's js/native targets but for jvm it worked out great for us.

[–] [email protected] 3 points 1 year ago

Used it for few years in a spring boot api layer. Absolutely loved it. Migrating to typescript now, but that’s not due to Kotlin.

More due to

  1. not being a fan of spring boots magic
  2. our backend being very light
  3. wanting a unified language for our small team of full stack developers.
[–] [email protected] 3 points 1 year ago

Lots of people do, just look at all the server libs for kotlin.

[–] static_motion 3 points 1 year ago

Loved using it when I took a brief stint as an Android dev at my company. Later talked to my tech lead to see if he was open to me writing future backend developments in Kotlin but he said it would be too much unneeded work to get the entire team to learn a new language to keep the backend maintainable.

[–] [email protected] 2 points 1 year ago

I don't know if it's popular but a few companies use it for backend servers instead of using Go or Node.js. It's a language that I really enjoy even if I have never used it professionally.

[–] [email protected] 2 points 1 year ago (1 children)

maybe? I know I dont have the balls to suggest our enterprise sw migrate to kotlin. I love the language but I think getting management to make such a drastic change can be hazardous if it turns out to cause unexpected bugs that lose millions of dollars :( such is the life of a java programmer

[–] austin 4 points 1 year ago (1 children)

assuming you propose the idea to migrate to kotlin, it would go something like this:

  • talk to your other developers and see if they feel the same way. get other developer buy-in
  • propose the idea to management with reasons why it would be beneficial
  • management now either buys in and approves kotlin usage, or says it's not worth it

if management says yes, you now have like 20 people who have vetted and agreed with the idea. once you start writing Kotlin it's not like EVERYTHING is all of the sudden Kotlin. it's an iterative process, and hopefully you have test coverage. you can even re-use your existing java tests since the languages are interoperable. Assuming you follow a normal development process, the odds of a catastrophic bug coming out of nowhere to cause millions of dollars of losses wouldn't even cross my mind.

that being said, assuming the current code works decently well, management will have no motivation or reason to approve a total rewrite in a new language. it's more likely that they will only approve starting to trickle in kotlin for new projects or features, which even further reduces the likelihood of a catastrophic bug happening.

[–] [email protected] -2 points 1 year ago (1 children)

sadly, it would fail at the first step.

[–] [email protected] 1 points 1 year ago

I convinced my Fortune 500 company to allow Kotlin as an option for our dev teams, by pointing out:

  • It's Java compatible, and easy for Java devs to pick up
  • No rewrites needed to start using Kotlin
    • You could mix and match with Java at any point
  • It reduces boilerplate code
  • It reduces overall errors and bugs (improved type safety and null safety)
[–] [email protected] 2 points 1 year ago

Kotlin is used as the base of TeamCity's DSL, so I have to use it from time to time at work to configure build pipelines.
But I have never used it to build anything too complicated.
Seems like a massive step up from Java in terms of developer experience. But that's obviously just an opinion.

[–] [email protected] 1 points 1 year ago

Even Gradle has switched to Kotlin as their default DSL language.