Lol! just lol! Swift is, perhaps, the most carefully designed modern language based on a small set of explicit principles, articulated "philosophy" (clarity at the use site) crafted with an unprecedented attention to details (sometimes zeal is better that a standardized kitchen-sink syndrome of C++ or over-engineering narcissism of Scala), while Kotlin is just an unduly ambitious crap, like everything Russian.
Swift is like Kotlin
341–350 of 364 posts
Re: Swift is like Kotlin
#342Past the syntax similarities, both of these languages are intended replacements for an 'old' language (Objective-C => Swift, Java => Kotlin) on a dominant mobile platform, with interoperability as a major selling point (requirement?). As a mobile dev (mainly iOS) this is awesome to see and although I love me some Objective-C, working with swift has been a pleasure. Now Java on the other hand... ( shudders ). With Goo…
It may be true for Swift but Google never claimed Kotlin is replacement of Java. I guess people are getting overly excited and making claims that Google did not. Kotlin is low effort developer friendly move by Google. Jetbrains will do work on language and tooling and Google would provide some Android-Kotlin related docs and support.
Re: Swift is like Kotlin
#343Earlier quoted context omitted.
seeing reduce in swift made me think about the universality of fold, which is the paper linked.
Ah, was about to say that all goes back to lambda calculus by Church and could be found in Lisp probably around ~1958.
Re: Swift is like Kotlin
#344Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base. This is the rare case where bad naming choice really hurts. No matter how good is the language, you will have to hear and pronounce that name many times a day, and even associate yourself with it (e.g. "a Kotlin developer" in your resume). Not something to be taken lightly.
It has nothing to do with military bases. Just a memorable, concise name which sounds good in many languages.
Re: Swift is like Kotlin
#345I presume Kotlin also traps out-of-range array accesses.
Re: Swift is like Kotlin
#346Does anyone else think the Kotlin syntax for array literals is super ugly: val shoppingList = arrayOf("catfish", "water", "tulips", "blue paint") What is wrong with square bracket syntax? (rant over). EDIT: I suppose it's consistent with other syntax e.g. listOf() etc.
First thing I noticed. The map entry syntax: "Foo" to "Bar" Is also nonsensical. What's wrong with ':'?
The to method constructs a Pair object from its arguments, so
"Foo" to "Bar"
is just a prettier way of writing: Pair("Foo", "Bar")
The mapOf function (which is just a normal function) takes a variable number of Pair objects as parameters.Re: Swift is like Kotlin
#347Earlier quoted context omitted.
> I assume Google will try to replace Java with Dart I would have expected this, but not after pushing Kotlin. Kotlin is shiny enough to temporarily distract the typical developer from the daily struggles with the abysmal Android API. Kotlin and Java it will be for the next 10 years, for better or worse. Dart is not very popular within Google itself, and Fuchsia is nothing more than a paid hobby project[0]. [0] See h…
> Dart is not very popular within Google itself I was under the impression that pretty much all the frontend work at google was compiled from Dart.
It's also used for Google's internal CRM (Greentea), and Google Fiber.
[0] http://news.dartlang.org/2016/03/the-new-adwords-ui-uses-dar...
[1] http://news.dartlang.org/2016/10/google-adsense-angular-dart...
Re: Swift is like Kotlin
#348Earlier quoted context omitted.
I assume Google will try to replace Java with Dart, because they have recently been focused on Flutter [1] [2] and Fuschia [2] development which are (mostly) C++ and DartLang stack. [1]: https://flutter.io/ [2]: https://github.com/flutter/ [3]: https://github.com/fuchsia-mirror
> I assume Google will try to replace Java with Dart I would have expected this, but not after pushing Kotlin. Kotlin is shiny enough to temporarily distract the typical developer from the daily struggles with the abysmal Android API. Kotlin and Java it will be for the next 10 years, for better or worse. Dart is not very popular within Google itself, and Fuchsia is nothing more than a paid hobby project[0]. [0] See h…
It's also used for Google's internal CRM (Greentea), and Google Fiber.
[0] http://news.dartlang.org/2016/03/the-new-adwords-ui-uses-dar...
[1] http://news.dartlang.org/2016/10/google-adsense-angular-dart...
Re: Swift is like Kotlin
#349Earlier quoted context omitted.
Sorry, I don't see the difference. With read-only you can create a new object which is the first element of the list and also points to the rest of the list. Instead of an structure you have an "immutable" object.
Yes, but the resulting object is not a "List" and hence would not inter-operate with any function that took a List as input. In essence if the original object implements a List _interface_, then the new one should as well. If you do all of this, then you've essentially implemented immutability and structural sharing. But then you have to do this for 10 other Collection types as well. Now, you could do all this, but I…
Re: Swift is like Kotlin
#350There does seem to be broad agreement across a range of typed languages -- TypeScript, Swift, Kotlin, ES6 + Flow -- about notations for classes, control flow and data structure declaration. But true convergence remains far away...
Don't forget that Scala preceded all of the languages you've listed, which in my opinion shows where the inspiration came from for some of them. Of course, I'm sure that Scala drew inspiration from some of its predecessors.
// Type indicated with `:`, type follows variable; value follows type.
variable: Type
variable: Type = "value"
// Generics with
strings: List
// Operator overloading.
text = "a" + "b"
num = 1 + 2
// Capitalize type names.
class TheClass { ... }
// Use braces for delimiting.
class TheClass { ... }
Most of the conventions we're talking about were adopted by Scala; but we can see they also predate Scala. Many can be found in C++. The type/variable notation is very old, going back to ML and truthfully going back to mathematical notation.