6 ms·
Someone should write "Scala features I miss most in Kotlin"
by lanna 9y ago
Someone should write "Scala features I miss most in Kotlin"
- xaduha 9y agoNo, that's not how it works. No one is forced to write Kotlin I don't think. Plenty of people have to use Java. The fact that Kotlin is a simpler language than Scala is a feature, not a bug.
- wtetzner 9y agoIs Kotlin actually simpler than Scala? It seems to be less powerful in a lot of ways, but on the other hand, it looks like a lot of Kotlin's features are special-case things, whereas Scala's features are largely orthogonal and composable. I haven't really used Kotlin much, so I may be wrong, but that's the impression I get.
- emodendroket 9y agoIt's simpler for a compiler at least
- andybak 9y ago> Is Kotlin actually simpler than Scala? Unless Scala has radically been pared back in the couple of years since I read about it or I was seriously misinformed at the time, then I'd say it probably a yes. Scala has the reputation for being at the complex end of the language spectrum. Is that undeserved?
- necrobrit 9y agoIt's both... simultaneously. The "feature set" really is smaller than Java or Kotlin (especially if you count in terms of "keywords as features" and ignore things included for Java compatibility). The flexibility though can be genuinely overwhelming (the name, scala[bility], refers to scalability of the syntax, not performance). Both in terms of the syntax flexibility , e.g. where curly braces are optional vs not or different ways of writing lambdas, and powerful/flexible features like implicit. However there are very rarely special cases to these, it's all very consistent once you know the rules. Even the infamous underscore is "logically" consistent in it's use, it's just a placeholder in both contexts you typically see it used (context of variables and context of types). Even my go-to example of a special case in scala, vararg unpacking: `foo(myArgs: _*)` Despite being a special case actually reads kind of consistently.. it reads like a type ascription[1] asking for myArgs to be treated as a varargs of whattever type. So consistent with other "type context" usages of underscore despite otherwise being weird. [1] https://docs.scala-lang.org/style/types.html#ascription https://docs.scala-lang.org/style/types.html#ascription
- oelang 9y ago> refers to scalability of the syntax And the flexibility of the type system and the advanced type inference.
- lmm 9y agoThe reputation is undeserved as a description of the language proper; it's a flexible and powerful language that allows libraries to do quite a lot, so people often mistake library features for language features. In a way it ends up being a bit like lisp: a toolkit for allowing you to construct your own (hopefully domain-appropriate) language rather than a language as such. Like how people will sometimes criticise Ruby for things that turn out to be a Rails feature rather than part of the language itself. It is fair to say that many Scala codebases are complex and difficult to work on. It's a language that punishes poor choice of libraries much harder than many languages (particularly if people are used to JVM languages - what libraries/frameworks can do in Scala is much closer to what they can do in Python/Ruby/...). I don't think it's "fair" to compare Scala to Kotlin on those grounds, simply because we haven't had time for generations of Kotlin frameworks to build up. But obviously that kind of fairness is not your concern if you're a business making a choice of tools. If you're choosing a language for a short-lived codebase then Kotlin might be a good choice if it does what you want. What I would say is, if you're trying to choose a language for a codebase that will live for 5-10 years, try to think about what Kotlin is going to look like in 5-10 years. Right now Kotlin is able to be a lot cleaner than Scala (at least on a superficial level) because it doesn't have backwards compatibility with large existing codebases hanging over it. That isn't always going to be the case.
- xaduha 9y ago> Is Kotlin actually simpler than Scala? Java was described as "blue-collar language". I probably won't call Scala that, but it fits Kotlin fine in my opinion. another comment on that subject https://news.ycombinator.com/item?id=15298075 https://news.ycombinator.com/item?id=15298075
- emodendroket 9y agoKotlin is an officially supported Android development language. I'm sure some people get paid to work with it
- pyrale 9y agoLet's wait until a smug haskeller one-ups you with language snubbery.
- curun1r 9y agoSomeone could just as easily create a similar list of "Scala features I'm glad I don't have to deal with in Kotlin."