# Kotlin or Swift? (isn't a flame war, its about opinion)

**URL:** <https://discuss.kotlinlang.org/t/kotlin-or-swift-isnt-a-flame-war-its-about-opinion/5027>\
**Category:** Native\
**Created:** [October 18, 2017, 10:22am UTC](https://discuss.kotlinlang.org/t/kotlin-or-swift-isnt-a-flame-war-its-about-opinion/5027 "2017-10-18T10:22:03Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![DonWills](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@DonWills](https://discuss.kotlinlang.org/u/DonWills)\
**Post date:** [October 19, 2017, 7:52pm UTC](https://discuss.kotlinlang.org/t/kotlin-or-swift-isnt-a-flame-war-its-about-opinion/5027/8 "2017-10-19T19:52:02Z")

</div>

I have several criticisms of Kotlin. Here’s a random sample.

Array handling is inferior to Java in several ways. One is a performance concern - in Kotlin/JVM, a method call needs to be made to access or mutate an element, not so in Java. The lack of static fields and methods is a giant mistake. The requirement for “var” vs “val” is a huge annoyance. Having multiple syntaxes for specifying lambdas is another bad decision. “lateinit” is ugly and really doesn’t accomplish anything positive - it just fixes an issue with Optional that should not exist (see one of my comments below). In short, specifying nullability should be optional, not required. I truly dislike opinionated programming languages, which seem to be all the rage today. Kotlin and Swift are far too opinionated for my taste.

The cost of maintenance of big systems is my number one concern and in that regard Kotlin doesn’t seem to me to be any better than Java. Compile times are worse. Tooling is worse. For Kotlin to succeed, it needs to be superior to Java, not just similar.

Here are 4 items that I’ve posted here. The comment threads on these posts are enlightening about the mindset of the language designers with respect to the concept of “pragmatic”.

> [@What is the advantage of "companion object" vs static keyword](https://discuss.kotlinlang.org/t/what-is-the-advantage-of-companion-object-vs-static-keyword/4034):
>
> Again, newby to Kotlin here. Generally, the changes from Java are great improvements. That said… Why was the companion object concept created instead of using the static keyword for class methods and fields? I find it cumbersome, and it clashes with my style of writing code which is to put public methods at the top of a class and private methods at the bottom. I also understand that accessing methods in the companion object from instance methods is more expensive within a class, as compared…

> [@Vararg vs. array parameter](https://discuss.kotlinlang.org/t/vararg-vs-array-parameter/4068):
>
> In Java, a varargs parameter can be called using either an array or a list of values. Thus, this works: void code() { abc("A") String[] array = new String[1] abc(array) } void abc(String... x) { ... } I’d like the same option to allow library users to call the method with a zero or more parameters, or with an array of parameters. So in Kotlin, I tried this code: fun code() { abc("A") val array = Array\<String\>(1) { "B" } abc(array) } fun abc(vararg x: String) { ... } w…

> [@Overloading == with different types of operands](https://discuss.kotlinlang.org/t/overloading-with-different-types-of-operands/4059):
>
> Newbie here. Hopefully I’m missing something. I’m building a library for exact fractional decimal math using operator overloading. The arithmetic operators work. The fact that assignment overloading is not supported is inconvenient for the application programmer using the library, but it’s not a showstopper. However, I’ve just now bumped into what I really hope is my mistake. Here’s the general outline of the code: class Num : Comparable\<Any\> { ... override fun equals(other: Any?): B…

“platform types” (the Kotlin name for the Java not doing null checking on call) should be an available to Kotlin programmers. Read the comment thread here -

> [@Suggestion: replace "lateinit" with ! after type](https://discuss.kotlinlang.org/t/suggestion-replace-lateinit-with-after-type/3965):
>
> I come to Kotlin from Swift (and Java of course). One minor syntax thing about Swift that I like better than Kotlin is the use of the ! after the type in var definitions instead of the ugly (IMO) “lateinit” keyword. (Swift calls the feature “Implicitly Unwrapped Optionals”.) I realize this is a breaking change, so it won’t happen soon, but maybe for version 2? FWIW, in general, I like Kotlin much more than Swift. I appreciate the Kotlin designers reluctance to add features just for the sake …

One more thing - IMO, Kotlin could become a much better language if it included some sort of fixed decimal arithmetic. But that does not seem to be in the list of planned features.

> [@D128 basic type](https://discuss.kotlinlang.org/t/d128-basic-type/3953):
>
> I’ve noticed that Rust has the d128 primitive type (128 bit exact decimal fractional type). Is adding the d128 basic type in the plans for a future release of Kotlin? Fixed decimal arithmetic is critical for many business-oriented applications. (Did you see the movie “Office Space”?)

---

_[View the full topic](https://discuss.kotlinlang.org/t/kotlin-or-swift-isnt-a-flame-war-its-about-opinion/5027)._
