10 ms·
> but is infuriatingly unwilling to listen to experience of what works in large codebases. I don't think so. Java has been used successfully in large codebases
by pron 9y ago
> but is infuriatingly unwilling to listen to experience of what works in large codebases.
I don't think so. Java has been used successfully in large codebases, probably more so than Scala, and Kotlin, like Go, is a language following Java philosophy.
> I think Kotlin has literally every one of those ad hoc solutions built into the language, but stubbornly avoids making the generalisation.
1. Ask yourself why does it stubbornly avoid making such generalizations. There are very, very good reasons.
2. Kotlin has delimited continuations, which express anything monads can (with a minor, unimportant caveat, which has to do with the particular features of Kotlin coroutines), in a way that blends much more nicely with imperative languages features that abound in both Kotlin and Scala, and composes much more nicely than monads (although that requires a feature currently absent an Kotlin's coroutines, but the feature is largely unnecessary for the kind of code Kotlin aims at).
> already there's no way to reuse logic between code paths that operate on Kotlin nullable types, Java Options
That's not really accurate. Kotlin does this blending at least as well if not better than Java. Java options are not really intended to be used in the same way they're used in Scala.
> or rust-style Result types (for which there are several Kotlin libraries already, because it's a very useful concept and the language mostly has the facilities to support it)
Those are not idiomatic in Kotlin, and some (like me) think that the Kotlin idioms are better, at least for the kind of code it aims to support.
> But since the language won't let you represent what these types have in common, your only option is to copy/paste the code.
I don't think it is a language's job to support all idioms out there, even if they can be useful in some circumstances. Languages following the Java philosophy -- as opposed to Scala -- aim to be at least somewhat opinionated, and encourage similar coding patterns in all cases, even if some idiom can be marginally better suited in some specific case. It's a tradeoff between code homogeneity and being "multi-paradigm", which can only be settled by the values of the language. There is no right or wrong answer here. Kotlin's values are very, very different from Scala (even if many features are shared), which is why Kotlin was created in the first place. Its designers wanted a modern language in the Java tradition (I know that from directly talking to them), not in the Scala tradition.
- lmm 9y ago> Java has been used successfully in large codebases, probably more so than Scala, and Kotlin, like Go, is a language following Java philosophy. Java didn't have anything like as many ad-hoc language-level features as Kotlin has - checked exceptions are the only thing that's really comparable, and their reputation is decidedly mixed (note even Kotlin hasn't included them). > Kotlin has delimited continuations, which express anything monads can (with a minor, unimportant caveat, which has to do with the particular features of Kotlin coroutines) They can, but only in the same sense that an untyped language can express anything that a typed language can. They can express any effect but they can't express restricted subsets of effects. You could presumably write a continuation-based equivalent of traverse (though I'd be interested to see what it looks like in practice), but you can't give it the level of type safety it should have, and you can't write sequence when your effects aren't representable. > Kotlin does this blending at least as well if not better than Java. Not convinced; nulls aren't integrated as tightly into the language in Java (e.g. no elvis operator) and you don't have to deal with platform types. You can write Option-oriented code without it being a second-class citizen, though admittedly the second-class citizen experience in Kotlin may not be so much worse than the first-class citizen experience in Java. > I don't think it is a language's job to support all idioms out there, even if they can be useful in some circumstances. Yes and no. A language doesn't have to support everything out there, but putting together any of the features it does support should work the right way; it's not at all clear that this is the case for kotlin . And certainly when you end up copy-pasting code because you're using the same logic but the language doesn't let you express how it's the same, that's a problem with your language.
- haspok 9y ago> And certainly when you end up copy-pasting code because you're using the same logic but the language doesn't let you express how it's the same, that's a problem with your language. That is not the case. Sometimes language designers and maintainers _deliberately_ avoid language constructs that allow for more generic code. More generic is not always better, definitely not when you have to read and understand the code, and find a bug in it, for example. The more layers of abstractions you have, the harder it is to construct a model of it in your mind. (An example of this approach is Erlang, where parameterized modules were introduced as an unsupported, "beta" feature at some point, then a few major versions later they were removed. Why? Take this opinion, for example: "I would gladly reconsider my somewhat harshly critical position on parameterized modules if shown a clear example of how their use improves the readability or expressiveness of code. Until then I would urge that they didn't become an official part of the Erlang language." http://erlang.org/pipermail/erlang-questions/2010-February/049637.html http://erlang.org/pipermail/erlang-questions/2010-February/0...)
- venturis_voice 9y agoHi, thanks for commenting on our recent blog post. We share and discuss all our content on Venturi’s Voice Slack group. Seeing as you know quite a bit about this topic it would be great if you joined the conversation on there. We’re a new community based around the blogs and podcasts we release everyday at Venturi. We aim to consistently deliver valuable content to our candidates - but we know there is always room for improvement, so your feedback would really help us out! The group’s pretty quiet at the moment whilst we’re building up the community but stick with us as we’re aiming to grow it rapidly. https://publicslack.com/slacks/https-venturisvoice-slack-com/invites/new https://publicslack.com/slacks/https-venturisvoice-slack-com...