Data Classes are the biggest, most obvious candidate. You can write a Java Bean - with Fields, Getters, Setters, Constructor, Equals, Hashcode, ToString and some extra convenience methods - in a single line of code.
Other than that, pattern matching is a huge win for me, and blocks as expressions. Type Inference is useful but it's not the killer feature that some people make it out to be - IntelliJ does most of that typing for me anyway.
I might end up spending some articles in my "100 Days of Writing about Code" covering these in more depth when I run out of things to say :)
Have you tried Lombok with Java? Since we started using it, my team loves it. @Data is what you want.
The only thing I'm missing from Erlang is Pattern matching, but at method signature level. I think also Kotlin can't do it, right?
I used to use and like Lombok, but less so now. It looks and reads like real Java but does things behind the scenes, which isn't obvious if you don't know about it. Using a different language is much more obvious what's happening, even if it's much bigger.
Data classes are also only scratching the surface of the extra features - better lambdas, destructing, coroutines, etc. Even just template strings can be a huge boost if you're writing things like DAOs with complex queries in then.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Enjoyed your article. Could you share some code examples were kotlin has helped you?
Seconded. I've not been a huge fan of Java but I'd never even heard of Kotlin. Would love to see some examples from someone evangelising it :)
Data Classes are the biggest, most obvious candidate. You can write a Java Bean - with Fields, Getters, Setters, Constructor, Equals, Hashcode, ToString and some extra convenience methods - in a single line of code.
Other than that, pattern matching is a huge win for me, and blocks as expressions. Type Inference is useful but it's not the killer feature that some people make it out to be - IntelliJ does most of that typing for me anyway.
I might end up spending some articles in my "100 Days of Writing about Code" covering these in more depth when I run out of things to say :)
Have you tried Lombok with Java? Since we started using it, my team loves it. @Data is what you want.
The only thing I'm missing from Erlang is Pattern matching, but at method signature level. I think also Kotlin can't do it, right?
I used to use and like Lombok, but less so now. It looks and reads like real Java but does things behind the scenes, which isn't obvious if you don't know about it. Using a different language is much more obvious what's happening, even if it's much bigger.
Data classes are also only scratching the surface of the extra features - better lambdas, destructing, coroutines, etc. Even just template strings can be a huge boost if you're writing things like DAOs with complex queries in then.