Anything stand out to you?
Today? Today.
ā¦ also that Google wants to increase their consumption of my data, particularly in tying it to the social interactions associated with it, and that is not something I think is good for the world in general.
That said ā¦ Kotlin on Android -> niiice.
Google finally have a non too shitty language on their stack. That is all. And even is Kotlin is nice, it is still quite Java.
(for those that wonders, the official Google languages were Java, C++, Go, Python and Dart. Python is not too bad, but outside of thatā¦)
Dart and Golang are better than any other languages in the world.
ā¦and why do you think that? Or perhaps the question should be why did you feel the need to register to say so
Great question @sgon0000. You have no examples of why, no reasons of why, nothing backing up the phrase?
Hmm, letās take an example from the official documentation examples of each, recursive fibonnaci:
Dart:
int fibonacci(int n) {
if (n == 0 || n == 1) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
Go:
func fib(n uint) uint {
if n == 0 || n == 1 {
return n
} else {
return fib(n-1) + fib(n-2)
}
}
So immediately, lots of braces, flow control does not exit at end of function but rather at annoying returns
. The if
conditionals do not seem to return their last value in each, that is irritatingā¦ Etcā¦
Rust:
pub fn fibonacci(n: i32) -> u64 {
match n {
1 | 2 => 1,
_ => fibonacci(n - 1) + fibonacci(n - 2)
}
}
Well still has annoying braces, but conditionals return their last values and it propogates upwards, no surprising early returns.
Elixir:
def fib(0), do: 0
def fib(1), do: 1
def fib(n), do: fib(n-1) + fib(n-2)
Braces (and other delimiters like do/end) are gone, it pattern matches in the head, very readable, etcā¦ Though a more direct conversion should probably be this:
def fib(n) when n==0 or n==1, do: n
def fib(n), do: fib(n-1) + fib(n-2)
Though that is less elixirāy.
OCaml:
let rec fib = function
| n when n=0 || n=1 -> n
| n -> fib (n-1) + fib (n-2)
Or perhaps also:
let rec fib = function
| 0 -> 0
| 1 -> 1
| n -> fib (n-1) + fib (n-2)
So the syntax of many others is immediately better.
Rust compiles to faster code with more simple code (Go can often get about as fast as rust, mostly, but it requires significantly more code to do the same tasks).
Just a couple things immediately on mind, got a dozen others while typing this out too, but eh, more data points than the original post. ^.^
/me has fun with language comparisons, they are a junk-shoot, but still fun. ^.^
First, thanks a lot for replying me to show my existence. Normally, I just speak to myself, nobody cares. To answer your question, Itās because I hate java and kotlin. I hope java to die for many and many years. But now, kotlin tries to save javaās life by changing the name. How funny is that! Google now can bypass oracle by simply changing the languageās name. LOL. Apple creates its own language, swift, and get all other people very excited and use it. Compared the history of swift to dart and golang, how stupid is google! Dart and Golang could be more successful than swift. Flutter could be more successful than react native. Google never push its own language hard. I was google lover and apple hater. Now, I hate google more and more everyday. I canāt wait to see fuchsia kills android. Stupid android team! They will pay for choosing kotlin instead of dart. Finally, thank you very much for replying me again. I think I will just shut up here and wonāt post any further comments, otherwise, people may think I am even more crazy. PS: I knew there were differences btw kotlin and java, but they are still the same language and using jvm after all.
Yeah I worked with a lot of java in my last job and for last hobbies for over 5 years, that was hell, it is such a poorly designed languageā¦ >.>
I tried swift but could not really get in to it, it āfeltā wrong in a few ways, mostly in the APIāsā¦[quote=āsgon0000, post:7, topic:5126ā]
Flutter could be more successful than react native.
[/quote]
Flutter is quite an interesting API! Iāve been messing with it in my spare time the past 2 weeks. Iād prefer an actually decent language instead of Dart for it, but it is not bad as an API at all!
Uhh, Fuschia is Googleās. ;-)[quote=āsgon0000, post:7, topic:5126ā]
They will pay for choosing kotlin instead of dart.
[/quote]
Dart has runtime performance hits that Kotlin does not have though, they both rather suck, but for different reasons.
Yep, Kotlin is just a fresh layer on java, just like Elixir is a fresh layer on Erlang, same language, different syntax, some macroāing abilities in both. ^.^
And using Intelij IDE you can easy auto convert any java code to Koltin, so portability is perfect as IDE support what I canāt say about Scala (ide support can be poor with more complicated code).
āWe will be partnering with Google to create a non-profit foundation for Kotlin. Language development will continue to be sponsored by JetBrains, and the Kotlin team (over 40 people and second largest team at the company) will operate as usual. Andrey Breslav remains the Lead Language Designer, and Kotlin will be developed under the same principles as before. Weāll keep our design processes open, because your feedback is critical for us in moving Kotlin in the right direction.ā
Thatās because most of the APIs were written with Cocoa / Objective C in mind The actual language is pretty neatājust reading through a description may make it seem like it has a kitchen sink of features, but I think it enables lots of interesting paradigms in a thoughtful, pragmatic way, taking plenty of nice features from lots of other languages.
That description sounds like Scala.
Well, Scala has moreā¦ so much moreā¦ >.>
guiltily glances over at the half-read copy of Programming Scala on the shelf
Hehe, I have a dozen scala programs and libraries around on my SVN server, sooooā¦ >.>
For a JVM language it is awesome. Arenāt they building a native compilation back-end too now?
I mean, the type features are cool, but the implicit stuff is a little annoying. As far as functional languages go, I find it much less clear than e.g. Haskell or OCaml. I think itās all the square brackets making my eyes water. Iāll agree that if you have to use the JVM itās great, but what kind of a life is that It does seem they are, sounds interesting!
Incidentally, I did some contract work in Scala on a Play web app a few years back. I implemented some service or other with Akka, not knowing at all how actors are supposed to work. Now that Iāve got some experience with Elixir, I cringe at the fact I got paid for writing that >.>
Ooo that is cool!
I actually found there was not a lot of implicit stuff other than implicit variables (which are pretty well opt-in anyway), or are you referencing something specific?
Hehe, Akka is not bad, there is an Akka.net now too.
I hate Scala implicit hell and prefer Kotlin function extension
Scala
object Helpers {
implicit class IntWithTimes(x: Int) {
def times[A](f: => A): Unit = {
for (i <- 1 to x) {
f
}
}
}
}
Then later in the code you can do:
import Helpers._
5.times(println("Hello"))
Kotlin
fun Int.times(f: ()->Unit) {
for (i in 1..this) {
f()
}
}
5.times {println("Hello")}
from
Wonder how many of the announced services Google will kill in a year or two.