3 ms·
If it's not null-safe I will avoid it for new projects. Lambda's: great! But real null-safety, strong type safety, proper sum types, pattern matching/ type des
by cies 6y ago
If it's not null-safe I will avoid it for new projects.
Lambda's: great! But real null-safety, strong type safety, proper sum types, pattern matching/ type destructuring, are now my requirements.
I'd say Kotlin is the language with the most adoption that ticks the boxes. And it is (not surprisingly) an OO lang.
- dunefox 6y ago> I'd say Kotlin is the language with the most adoption that ticks the boxes. How? Kotlin is decisively an object oriented language.
- sk5t 6y agoKotlin pattern matching and destructuring/unapply support are pretty weak, no?
- gher-shyu3i 6y agoYes, Java's pattern matching is much more fully fledged than Kotlin's. You can destructure nested types. Also, at some point in the (near) future, you should be able to do things like: Object o = new int[]{1, 2}; if (o instanceof int[] {var a, var b}) { // a == 1, b == 2 }
- gher-shyu3i 6y agoIncidentally, pattern matching that Java is getting is superior and more fully fledged to the one that exists in Kotlin. You can also have null safety in Java by means of annotations. You can also check out C# since it fits your requirements. It has pattern matching, but sum types are still in the works.
- cies 6y agoI've grown a strong dislike for annotations. One here or there is not the problem, but they will be used (I'm looking at you Spring) to add magic to my programs. I want to know what goes on; annotation hide what goes on. Debugging problems with annotations is a real pain. I like that in Kotlin the community seems to fight overuse of annotations (also they fight overuse of Exceptions which I really like: Exceptions are not a way to do multiple return values, sumtypes are).
- cies 6y agoOn sum types in C#: https://www.reddit.com/r/csharp/comments/7b8mvn/have_sum_types_ever_been_considered_by_the_c/ https://www.reddit.com/r/csharp/comments/7b8mvn/have_sum_typ...