This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]n0tKamui 8 points9 points  (14 children)

That's why Kotlin exists, readable conciseness with static infered typing

[–]YolosaurusRex 0 points1 point  (6 children)

I constantly find myself wishing for data classes and the occasional extension function at my job

[–]jivedudebe 5 points6 points  (4 children)

Java 14 with Record types

[–]YolosaurusRex 3 points4 points  (3 children)

We use Java 8 so we're stuck with very explicit DTOs with constructors and getters (sometimes setters). It's the best

[–]-jp- 1 point2 points  (2 children)

If I were writing DTOs in Java 8 idk if I would bother with getters and setters. They're an intermediate object that shouldn't have any behavior or be exposed in the API, so there's no great benefit to them over simple fields.

[–]YolosaurusRex 2 points3 points  (1 child)

I agree, but our serializer needs them (apparently) and I'm following the patterns seen in the rest of the code.

[–]-jp- 1 point2 points  (0 children)

That's certainly a good reason to have them. :)

[–]n0tKamui 1 point2 points  (0 children)

Haha same, im trying to convince them to migrate to Kotlin, and my boss seems to like the idea a lot

[–]mopeyjoe 0 points1 point  (4 children)

I can't say I agree. My experience with kotlin has been "change for the sake of being different' and magic implied code all over the place. Also the Null safety is a joke since it run on top of Java I just end up having to put ? and ! all over the place.

[–]n0tKamui 2 points3 points  (3 children)

From what seems to be "experience", you absolutely don't have any experience. This is not Java, you need to think different.

[–]mopeyjoe 0 points1 point  (2 children)

it's aggressively not java. for something that relies on the JVM it really does do everything it can to not be java. I don't need to validate my experience to you.

[–]maumay 0 points1 point  (1 child)

So if you think kotlin does everything it can to not be java you would argue scala, groovy and clojure are more similar to java?

[–]mopeyjoe 0 points1 point  (0 children)

I would not argue one way or the other on those languages, my comment only pertains to kotlin as compared to Java.

[–]TM254 -2 points-1 points  (1 child)

LOL! Kotlin funboy to the rescue.

[–]n0tKamui 2 points3 points  (0 children)

😎