1,795 karma · joined Sep 13, 2012 (14y ago) · 646 submissions
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
> In addition, Scala includes features that you won’t find in either Kotlin or Java, such as full support for pattern matching, macros, and higher-kinded types, which makes Scala ideal for big data processing tasks such as: graph analysis, aggregation computations, and complex, mathematically-focused modelling (e.g. medical modelling.)
This statement is unfortunately not backed by any explanation.
Kotlin has less Stackoverflow questions, but there is also less need for explanation.
Limited operator overloading in Kotlin is a good thing! I've seen way to many Scala with completely absurd and unreadable opertors.
Having worked with both Kotlin and Scala, I see Kotlin as much more pragmatic, what means real world suitable. While Scala was engineered with programming language research in mind (not an ivory tower language like Haskell, though), Kotlin considers more practical aspects like tool support or long-term maintainability. The Scala compiler is, for example, relatively slow. And what about binary (in)compatility in Scala? No word in the article. What about the imminent breaking change with Scala 3 (aka Dotty)?
Scala macros are problematic for tool support. Kotlin will probably get some kind of tool friendly meta-programming, but deliberately not macros.
> Kotlin may be widely considered the easier language to learn, but if it doesn’t have all the features you need, then those few hours spent familiarizing yourself with the Kotlin syntax was time that you could have spent starting to learning a language that does give you the functionality you need.
That may be true for some features, but Scala is a pretty complex beast with many advanced features, which are not only hard to learn, but which also make the code hard to understand or modify. Think of implicit conversions, implicit parameters, which can make it hard to understand what is going on by looking at the code.
Kotlin is much more readable in general: constructos are just named `cunstructor`, init blocks are called `init`, variadic argument are called `vararg`, annotations for co- and contravariance are called `in` and `out`. Scala has to offer method signatures like the following:
flatten[U](implicit ev: <:<[T, Try[U]]): Try[U]
Don't get me wrong, I don't want do condemn Scala and like it in principle, but I think that Kotlin is the better choice in most cases.comment 9y ago · link · parent
When we have web assembly and compilers like the Kotlin compiler that can translate a high-level language to web assembly, there is little need for framework specific compilation.
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
524.
Dark or white color theme is better for the eyes?(ux.stackexchange.com ↗)
3 points · by cryptos · 9y ago · 1 comment
comment 9y ago · link · parent
I'm thinking about creating a hierarchical forum like the usenet, but I'm sceptical whether this would earn enough money to work in the long run.
comment 9y ago · link · parent
The hello world example is symptomatic:
public class Example {
public static void main(String ...args) {
System.out.println("Hell, World!");
}
}
vs fun main(args: Array<String>) {
println("Hello, World!")
}
Some more examples: // java
for (Element element : collection)
// kotlin
for (element in collection)
// java
(OtherType) somehting;
// kotlin
somehting as OtherType
// java
a.equals(b);
// kotlin
a == b
// java
Color color = x < 5 ? Color.RED : Color.GREEN;
// kotlin
val color = if (x < 5) Color.RED else Color.GREEN
And some more like constructors just named "constructor", init blocks are name "init", varargs are prefixed with "vararg", type checks with "is", ranges with 1..9, strings wicht embedded variables ...527.
Corda: Why Kotlin?(corda.net ↗)
1 points · by cryptos · 9y ago · discuss
528.
KotlinTest – flexible and comprehensive testing tool(github.com ↗)
3 points · by cryptos · 9y ago · discuss
comment 9y ago · link · parent
Kotlin is much more pagmatic (not only) in this regard, what is no surprise coming from a tool vendor.
532.
Why are radio buttons circles?(ux.stackexchange.com ↗)
6 points · by cryptos · 9y ago · 1 comment
537.
Why I abandoned Java in favour of Kotlin(hashnode.com ↗)
2 points · by cryptos · 10y ago · discuss
comment 10y ago · link · parent
A programming with more features is not necessarily better. The limited features of Kotlin (compared to Scala) are an advantage, if you change your point of view. Some advantages:
* easier to learn (a Java dev will be more productive than in Java in a day or two)
* easier to maintain since Kotlin doesn't allow so much hard to understand code constructs
* fewer discussions about the one true style or way to do something
* it's easier to build good tooling
* much faster compilation
* smoother Java interop
* performance implications are more predictable