4 ms·
As someone frequently flipping between Swift and Kotlin, while I don’t necessarily feel like Swift is massively superior, I often find myself thinking “why is t
by cosmic_cheese 1y ago
As someone frequently flipping between Swift and Kotlin, while I don’t necessarily feel like Swift is massively superior, I often find myself thinking “why is this so quirky and pedantic” when writing Kotlin.
For example, I really really wish Kotlin would adopt Swift style if let/guard let statements. Kotlin smart casting doesn’t work just often enough to not be able to consistently rely on it and the foo?.let { } syntax is ugly.
Combined with the JVM warts of gradle and jankiness of code stripping and obfuscation, generally speaking if I could opt to use Swift in place of Kotlin for Android dev I would do so in a heartbeat.
- joe_fishfish 1y agoHa, I switch between the two as well, but I feel the opposite. Kotlin is much more intuitive for me, and Swift is more clunky. I do miss guard lets in Kotlin, but that’s about it.
- _mlbt 1y agoHave you tried Skip Tools yet? It’s a set of tools intended to do just that. https://skip.tools/ https://skip.tools/
- cosmic_cheese 1y agoSkip tools is pretty cool and I very may well use it for at some point, but it works by translating Swift+SwiftUI to Kotlin+Compose and I’d prefer a more direct approach that lets me build Android binaries with Swift (preferably with the whole of UIKit available, though that’s not likely).
- _mlbt 1y agoFrom the FAQ… > Skip supports both compiling Swift natively for Android, and transpiling Swift into Kotlin. Read about Skip’s modes in the documentation. https://skip.tools/docs/faq/#modes https://skip.tools/docs/faq/#modes
- cosmic_cheese 1y agoYes, it transpiles a Swift+SwiftUI codebase into a Kotlin+Compose codebase. I don’t want that intermediary step, I want the Swift itself running on Android.
- _mlbt 1y ago> Skip supports both native mode - in which your Swift is compiled natively for Android - and transpiled mode - in which your Swift is converted to Kotlin. The mode is specified at the level of a Swift module. Each mode has strengths and weaknesses, and it is common to use both native and transpiled modules within a single Swift-on-Android app. https://skip.tools/docs/modes/ https://skip.tools/docs/modes/
- vips7L 1y agoThe ?.let syntax is terrible. I don’t see how anyone thinks it’s better than doing a normal if != null check.
- cosmic_cheese 1y agoThe only time I ever use it is when the if != null check doesn’t work (aforementioned smart cast failure) and I don’t feel like creating a local var to fix it.
- renewedrebecca 1y agoFeels like a lot of people like making dealing with null as complicated as possible.