One has structures, ARC, proper extensions, good protocols/interfaces, flexible enums, and runs natively. The other one doesn't. I think I'll choose the former.
Swift is like Kotlin
321–330 of 364 posts
Re: Swift is like Kotlin
#322Earlier quoted context omitted.
Sure thing... When will Jetbrain have a decent interface builder? Decent instrumentation? Decent documentation viewer? Can you get an object graph with JetBrains? Xcode isn't perfect, but it's way better than JetBrains. Just because one has one feature that one doesn't have, doesn't mean that Xcode beats JetBrain's IDE all day.
Nobody should be using IB at all for iOS development. Ever.
Re: Swift is like Kotlin
#323Earlier quoted context omitted.
Swift has both external and internal parameter names for functions. This is to make API design more readable, easier to parse through. For example, you can have a function like so: func greet(with greeting: String, to personName: String) { print("\(greeting), \(personName)!") } In the above code, "with" and "to" are external names, and are only available when calling the function but are not available inside the func…
Is there a parse-time reason that they required the "_" syntax, rather than simply: func greet(greeting: String, personName: String) { print("\(greeting), \(personName)!") }
Re: Swift is like Kotlin
#324Earlier quoted context omitted.
Sure thing... When will Jetbrain have a decent interface builder? Decent instrumentation? Decent documentation viewer? Can you get an object graph with JetBrains? Xcode isn't perfect, but it's way better than JetBrains. Just because one has one feature that one doesn't have, doesn't mean that Xcode beats JetBrain's IDE all day.
> Xcode isn't perfect, but it's way better than JetBrains. O_o Are you kidding me? People whinge all the time about jetbrains subscriptions, but I've literally never spoken to someone who's actually used their products and think that the alternative editors available (visual studio, xcode, etc) are actually better. There are some features like UI designers that you can't do without, but it's been a long time since I…
I use IntelliJ/Android Studio for Java, and that's about it.
Re: Swift is like Kotlin
#325Kotlin lacks the ability to do true functional programming that Swift has. Swift has pattern matching, recursive data structures (edit: specifically ADTs with enums or case classes is what I was thinking of here, should have written algebraic data types), tail call optimization, even some form of type classes, immutability (thanks @tmail21), and so on. Kotlin does not have any of these (edit: this is now partly false…
Same goes for Swift.
Any "hybrid oo functional" language will not do the functional thing as well as a dedicated functional language. If you're still gluing things together with types, functions will never be quite as first-class as they should be.
Re: Swift is like Kotlin
#326Kotlin lacks the ability to do true functional programming that Swift has. Swift has pattern matching, recursive data structures (edit: specifically ADTs with enums or case classes is what I was thinking of here, should have written algebraic data types), tail call optimization, even some form of type classes, immutability (thanks @tmail21), and so on. Kotlin does not have any of these (edit: this is now partly false…
What about immutability? A key part of functional programming is using immutable structures to avoid side effects. My understanding is that Swift has these to some extent ("let" vs "var", structs being immutable etc). And since Kotlin is built on JVM compatibility I _assume_ that Kotlin does not support an immutable style of programming. Maybe someone here has more clarity on this.
The underlying host doesn't imply anything about language support as that's handled at the compiler level, not at the machine or VM level.
Even in Haskell data isn't immutable if you have a debugger or modify the machine code. It's simply a tool provided and enforced solely by the compiler - other JVM languages do support it like Clojure or Scala.
Re: Swift is like Kotlin
#327Earlier quoted context omitted.
it's always confusing, in languages with ranges, whether the range includes the second boundary element or not. it's purely a matter of convention, after all. ruby has a..b and a...b, but even after years of using the language i have to look up which is which. a.. perfect notation - once you know the language handles both cases, a.. as for the "count - 1", it's not too bad because i find "inclusive" more intuitive th…
"a..b - 1" can also be written as "a until b" in Kotlin.
Re: Swift is like Kotlin
#328Earlier quoted context omitted.
You now have https://github.com/Kotlin/kotlinx.collections.immutable
Cool. This needs to be built into the language or somehow standardized by the community. With lack of standardization of immutable collections, there would be lots of different ways that libraries would implement immutability. This would result in losing one of the main benefits of functional programming (i.e. awesome composability).
Re: Swift is like Kotlin
#329I find it very annoying that Google and Apple are creating new languages to solve similar problems and not worrying about cross platform. If you write for Apple you've been told to use Objective-C and Swift. If you're on Android it's Dart and now Kotlin. None of that stuff is used for Windows or Linux development or even mobile on the other OS. I'm not a fan of proliferation of "platforms" but when it goes beyond lib…
Imagine having just one programming language where there is likely one gatekeeper. I doubt language innovation would happen with that setup.
:D
Re: Swift is like Kotlin
#330Earlier quoted context omitted.
Ah, but is there a line? Where does it get drawn? Without explicitly naming them, once you get into the realm of Stalinism or the holocaust, surely it wouldn't take too much imagination to come up with a few names too unsavoury even for you?
There is no line. Expression is turing complete. That you might not like something I say does not have any effect on my right to say it as a human being. Obviously the names are tongue in cheek jabs. There's no language called Auschwitz, afaik, and even if there was, it would have as much right to exist as Java or Python or whatever. You don't get to tell people what to name things just because you're offended. You g…
Your freedom to say what you want doesn't come with freedom from the consequences of saying it.