KotlinConf 2017 - My Transition from Swift to Kotlin by Hector Matos

preview_player
Показать описание
Note: Unfortunately due to an issue, the camera recording the speaker feed was not picked up during this session. We apologise for this.

As a Sr. iOS Developer that's been coding in Swift since Day 1, it would have once been said that loving Android would never have happened. I speak internationally on behalf of Swift, and I used to refer to Kotlin and Android as "The Dark Side". It wasn't until I actually tried out Kotlin that I can say that I'm OFFICIALLY wrong.

This talk dives into the many similarities between Swift and Kotlin and what you can and can't do with each that you can do in the other. With two communities divided, can there be one to unite them?

Рекомендации по теме
Комментарии
Автор

How could you LIKE automatic reference counting? Garbage collection was specifically designed so programmers never need to think about it, at the cost of performance in the early days. I can't see any advantage, and plenty of retain cycle disadvantages

BigCarso
Автор

I've done some significant work in both Swift and Kotlin and one thing that I have to say is, that not having structs in Kotlin never bothered me. Data classes are immutable and I always treat them as such, never mutating any state of them. I almost never used structs in a way where I'd want to modify copy of some data (for which structs would be ideal of course).

vyli
Автор

Isn't a Pair in Kotlin more like a Tuple?

phriendspin
Автор

Your first example is more of just a superficial comparison. Structs are value types and they operate different memory wise than a data class in some cases much more efficiently. There are no value types in Kotlin.

Second example:
You can access name and ordinal if you specify enum as a specific raw value.

Third example:
With properly wrappers you can create delegated properties and classes in swift.

The type erasure example is not actually great for either. Both examples are not actually useful examples for a real world product. Using Any in Kotlin allows no type safety btw

I am by no means hating on Kotlin. If I had to write code in something though I’d prefer to write it in swift

HaiderKhanZ