- SEMICOLONS ARE GONE
- Null checks are not necessary because of the compiler's null safety, but if you really want to use a null you can just put a ? after the type and boom it's nullable.
- No more typechecking THEN explicitly typecasting every time you want to use the thing, smartcasting is a thing and it's beautiful.
- You can suggest inlining a function OR A CLASS (!!)
- Type inference (java has this now)
- Data classes (auto generated equals, toString and hashCode)
- Operator overloading
- Extension functions. And by extension (lol gotem) extension lambdas!
- Sealed classes make typechecking much less ambiguous as you can only define subclasses of the sealed class in the same package as the sealed classs. That means nobody using the code can extend it for possibly nefarious purposes. Think of them as enums on steroids.
- when statement\expression. Really good switch alternative, and must be exhaustive when used as an expression.
Most of those are fancy syntax parsing, but damn this fancy syntax parsing has made my life so much easier. I can use all my java libraries flawlessly and its 10 times easier to write code because half of it isnt unnecessary stuff kept for the sake of back compat.
Heres a gist that shows some of the features and how the can be used: [Only registered and activated users can see links. ]