What are some cool features in Kotlin

Kotlin, the flop of the decade

  1. Items:Kotlin: The better Java
  2. Subjects:Kotlin, Android, Angular, Golem Akademie, Java, Jetbrains, programming language, Slack, TypeScript, virtualization

  1. Forums
  2. > Comments
  3. ›Software development
  4. ›All comments on the article
  5. ›Kotlin: The better Java
  1. theme
  1. 1
  2. 2

New topic Change view


  1. Kotlin, the flop of the decade

    Author: twothe 06.11.20 - 13:00

    It's Tuesday again, someone has invented a new Java dialect. Only somehow this person managed to get Google and Jetbrains on board this time. Anyone who reads the language quickly sees: a probably better salesman than he is a programmer.

    The 3 features that Kotlin feels are nice, but either only solve problems at kindergarten level, or create new ones in the process. "Lists can no longer be accidentally changed" wuhu! A problem I think I had the last time 10 years ago or so. And even if you think that could lead to problems, Java has had the immutable list for years. Not that anyone really needed them. The idea of ​​hiding setters and getters is already a problem with .NET because, as the caller, I never know what I'm going to trigger. Hopefully only a one-liner, but maybe a web server is triggered in the background and 20GB of data is processed. And all of this just so that a programmer saves 3 letters. And if I now set the value in the class itself, do I make a setter-call loop? One does not know...
    And there is no case anymore so that you don't forget the break ... Says every IDE to you in Java, and you can just use the brackets instead, but that was probably such a challenge for the Kotlin inventor that he designed the whole switch has killed, with all the disadvantages that brings with it.

    Like any other unnecessary JVM dialect, Kotlin will disappear into oblivion for the next few years, and will probably lie in the grave somewhere next to Scala.

  2. Re: Kotlin, the flop of the decade

    Author: foobarJim 06.11.20 - 13:20

    twothe wrote:
    --------------------------------------------------------------------------------
    > It's Tuesday again, someone has invented a new Java dialect.
    > "Lists can
    > no longer accidentally changed "wuhu! A problem I think
    > The last time I had it was 10 years or so. And even if you think so
    > That could lead to problems, Java has had the
    > Immutable list. Not that anyone really needed them.

    Immutability is particularly useful in parallel processing. You can define variables with "const" in Java, but just like with "val" in Kotlin, this only means that the reference to the object cannot be changed. Immutable lists also ensure that the object, in this case the list, is also immutable.

    > The idea
    > Hiding setters and getters is already a problem with .NET because I
    > As a caller, I never know what I'm going to do now. Hopefully only one
    > One-liner, but maybe there will also be a web server in the background
    > triggered and processed 20GB of data. And all of that just with one
    > The programmer saves 3 letters. And if I'm in class now
    > set the value myself, do I then make a setter-call loop? You know
    > not ...

    That only affects data classes. And who packs so much functionality in a data class? But Java gets the same with records. For the simple reason that it is more practical and clearer to write one line of code instead of 50 for a class that only contains data.

    > And case doesn't exist anymore so you don't forget the break ... Says
    > You can use any IDE in Java, and you can just use the brackets instead
    > use, but that was probably one of those for the Kotlin inventor
    > Challenge that he killed the whole switch with all of them
    > Disadvantages that entails.

    "when" can do more than "switch", e.g. differentiate between types and a lot more. But sometimes I still miss the power of "match" in Scala, e.g. in interaction with destructors.

    > Kotlin, like any other unnecessary JVM dialect, will return for the next few years
    > disappear into the sinking, and probably somewhere next to Scala
    > put in the grave.

    That is quite possible. But not because the Kotlin features are so bad, but because Java has followed suit.

  3. Re: Kotlin, the flop of the decade

    Author: MrTridac 06.11.20 - 13:28

    Almost full agreement.
    Especially for the "kindergarten" comment.
    The errors that Kotlin is supposed to prevent are noticed right at the beginning of every reasonable test.
    This only ensures that nobody works or tests carefully, because "the language" is so great and safe.
    We can prepare ourselves for thousands of super buggy apps that will be written by developers who are lazy to learn and test in the future.

    I cannot agree with the statement that Kotlin will disappear again.
    Unfortunately, too many hippie coders have jumped on the hype bandwagon.
    Because what's new is cool. C / C ++ is "bad" because it's old. This is the main reason for the hype of new programming languages. The "arguments" against C are sucked out of the fingers and actually show a certificate of poverty.
    "... accidentally changed ...", "... break; forget ..." ???
    For me this is a reason to question abilities.
    If a bridge engineer "forgets" to calculate the load bearing capacity correctly, his abilities are also called into question.

  4. Re: Kotlin, the flop of the decade

    Author: mnementh 06.11.20 - 13:28

    foobarJim wrote:
    --------------------------------------------------------------------------------
    > That is quite possible. But not because the Kotlin features like that
    > would be bad but because Java has followed suit.
    Correctly. And that Java keeps catching up is also due to the fact that the advantages of certain features of languages ​​such as Scala, Ceylon or Kotlin are demonstrated. And a real implementation solution is shown. Therefore, I do not consider these niche languages ​​to be pointless, even if they never conquer the mainstream. Kind of like Plan9 - some of the cool features ended up in Linux.

  5. Re: Kotlin, the flop of the decade

    Author: fifafunky 06.11.20 - 14:21

    Kotlin won't go away anytime soon. The community is already great and there are many reasons that speak absolutely for Kotlin:

    • It's insanely similar to Swift. That actually makes it the only sensible choice for native app projects at the moment. It has become much more realistic to develop two native apps instead of relying on a hybrid solution (just implemented for the first time in a project and it was a dream)
    • Kotlin Multi Platform is an extremely exciting project. It is still in its infancy but could have a lasting impact on cross platform development
    • The same applies to Jetpack Compose (The first version of Jetpack Compose for Desktop was just released.)

    Whether the language is particularly great or not is almost irrelevant as long as it makes a lot of things easier for me as a developer with the "trimmings". Anyway, Kotlin is super easy to learn and just works well.



    Edited 1 times, last on 11/6/20 14:24 by fifafunky.

  6. Re: Kotlin, the flop of the decade

    Author: Cheesecake 06.11.20 - 14:38

    twothe wrote:
    --------------------------------------------------------------------------------
    > It's Tuesday again, someone has invented a new Java dialect.
    > This time Google and Jetbrains only somehow managed to do it
    > to get on board. Anyone who reads the language quickly sees: a
    > Probably a better seller than he is a programmer.
    > ...

    No approval at all, but no such thing. What is the negativity? Clearly, Kotlin is "unnecessary" in the same sense that any improvement to anything is "unnecessary". We could continue programming in assembler or hit our heads with bones.

    I should add that I'm not a super duper expert in Java or Kotlin who knows every language feature inside out. However, with almost 25 years of programming experience in a whole range of languages ​​and application categories, I consider myself competent enough to be able to reasonably assess the two. I like Kotlin * much * better. I switched to Kotlin 3 years ago for everything else I would have written in Java.

    I find the following features extremely useful:

    - Independent functions without the pressure of having to turn everything around in a class.
    - Closures!
    - Lambdas / "First Class" functions! Everything that has to be done with dynamically assigned callback functions (e.g. event buses) can be written sooo much more elegantly in Kotlin than with the Java that I know (which, admittedly, is not the latest version). Especially the combination closures / lambdas is super practical.

    I think coroutines are also potentially a very powerful feature, the nature of which I have not yet fully understood and which is why I have not yet used it.

    I vaguely know that Java has caught up in some areas (especially lambdas / closures) (I don't have a precise overview, I know Kotlin better than Java). But that just means that the minds behind Java also think that these things make sense.

  7. Re: Kotlin, the flop of the decade

    Author: twothe 06.11.20 - 15:20

    cheesecake wrote:
    --------------------------------------------------------------------------------
    > I vaguely know that Java has since caught up in some areas (especially lambdas / closures)

    Yes, several years before Kotlin was invented. Which makes the rest of your reasoning a bit obsolete.

  8. Re: Kotlin, the flop of the decade

    Author: Cheesecake 06.11.20 - 15:50

    twothe wrote:
    --------------------------------------------------------------------------------
    > cheesecake wrote:
    > ---------------------------------------------------------------------------
    > -----
    >> I vaguely know that Java is there in some areas (especially lambdas / closures)
    > has since followed suit
    >
    > Yes, several years before Kotlin was invented. What the rest of your
    > Makes argumentation somewhat obsolete.

    That's not true.

    The first version of Kotlin was released in 2011. And as far as I could just google it quickly, Java closures have been able to do so since version 8, which appeared in 2014, i.e. 3 years later. And the way in which closures can be implemented in Java still seems to be quite cumbersome and associated with restrictions. What you can find about it are actually all more hacks and workarounds than real support. Kotlin has evidently made significant progress, and has done so from the very beginning.

  9. Re: Kotlin, the flop of the decade

    Author: pioneer 06.11.20 - 15:52

    twothe wrote:
    --------------------------------------------------------------------------------
    > ... booby

    Ego 1, clue 0

  10. Re: Kotlin, the flop of the decade

    Author: foobarJim 06.11.20 - 15:55

    twothe wrote:
    --------------------------------------------------------------------------------
    > cheesecake wrote:
    > ---------------------------------------------------------------------------
    > -----
    >> I vaguely know that Java is there in some areas (especially lambdas / closures)
    > has since followed suit
    >
    > Yes, several years before Kotlin was invented. What the rest of your
    > Makes argumentation somewhat obsolete.

    I'm not that far in Java right now. So please correct me if I'm wrong. But IMHO, lambdas in Java are nothing more than just SAMs, i.e. interfaces with a method. This ultimately leads to the fact that you have a huge number of SAMs flying around instead of simply using function types.

    However, this is due to the downward compatibility, that you cannot simply introduce something completely new without breaking with the old. Is also worth something.

  11. Re: Kotlin, the flop of the decade

    Author: spyro2000 06.11.20 - 15:57

    twothe wrote:
    --------------------------------------------------------------------------------
    > It's Tuesday again, someone has invented a new Java dialect.
    > This time Google and Jetbrains only somehow managed to do it
    > to get on board. Anyone who reads the language quickly sees: a
    > Probably a better seller than he is a programmer.

    That's right, at Google, Jetbrains and in the Sprint Team, of course, there are no such skilled programmers working as you are. Of course, they cannot judge the value of a language as competently as you can.

    > The 3 features that Kotlin has are nice, but only solve either
    > Problems at kindergarten level

    Lol, so much for that: D

    https://www.educba.com/java-vs-kotlin/

    > Kotlin, like any other unnecessary JVM dialect, will return for the next few years
    > disappear into the sinking, and probably somewhere next to Scala
    > put in the grave.

    Clear. Most certainly.



    Edited 1 times, last on 11/6/20 3:57 PM by spyro2000.

  12. Re: Kotlin, the flop of the decade

    Author: wasdeeh 06.11.20 - 16:00

    MrTridac wrote:
    --------------------------------------------------------------------------------
    > Almost full agreement.
    > Especially for the "kindergarten" comment.
    > The errors that Kotlin is supposed to prevent fall with every reasonable test
    > at the very beginning anyway.
    > This only ensures that nobody works or tests carefully,
    > because "the language" is so great and safe.
    > We can prepare ourselves for thousands of super buggy apps from
    > In the future, developers who are lazy to learn and test will be written.
    >
    > I cannot agree with the statement that Kotlin will disappear again
    > will.
    > Unfortunately, too many hippie coders have jumped on the hype bandwagon.
    > Because what's new is cool. C / C ++ is "bad" because it's old. That's the
    > Main reason for the hype of new programming languages. The "arguments" against C
    > are sucked out of the fingers and actually issue a certificate of poverty.
    > "... accidentally changed ...", "... break; forgot ..." ???
    > For me this is a reason to question abilities.
    > When a bridge engineer "forgets" the correct load capacities
    > calculate, you also question your abilities.

    LOL. And then the chutzpah to bring a civil engineer comparison. With such an attitude towards the methods and tools used, you would at best be laughed at in any other engineering discipline; in the worst case, you would hardly find a job.

    All I can think of is this xkcd:

    https://xkcd.com/2030/

  13. Re: Kotlin, the flop of the decade

    Author: hyperlord 06.11.20 - 16:22

    Come on, it's Friday - just better hop around and leave the adults alone.

  14. Re: Kotlin, the flop of the decade

    Author: apoth90 06.11.20 - 16:25

    Yes, C ++ is a totally safe and productive language ... once you have 20 years of experience with it.

  15. Re: Kotlin, the flop of the decade

    Author: twothe 06.11.20 - 16:39

    foobarJim wrote:
    --------------------------------------------------------------------------------
    > I'm not that far in Java right now. So please correct me
    > if I'm wrong about that. But IMHO, lambdas are nothing different than in Java
    > only SAMs, i.e. interfaces with one method. This ultimately leads to that
    > You have a lot of SAMs flying around the back instead of just
    > Use function types.

    Since Kotlin and Java run on the same JVM, the same bytecode will come out in the end. Kotlin cannot do "magic" on the JVM that Java cannot.

    One must not confuse what the programmer sees and what the JVM generates from it for bytecode. The SAMs as you call them are just a downward compatible visualization.

    > https://www.educba.com/java-vs-kotlin/

    - NullPointerExcptions are not a "frustration for all programmers" but only for beginners. Every better IDE also shows potential null pointers, if you still program them so that they can occur.

    - Extend Functions are classes that have been extended by a function. So exactly what an extends in Java does. You can argue about the necessary formality, but the fact that classes can spontaneously have new functions has always caused a lot of problems in JavaScript.

    - Coroutines: anyone who somehow thinks coroutines would be better than concurrent threads has not understood one or the other concept. Support for coroutines has existed in Java since 1.0, so no one has used it. There are good reasons: there are much better options. The argument that Android is single-threaded and that coroutine benefits are just plain wrong in every way.

    - Checked Exceptions: with Kotlin I can simply ignore expected program errors. Great! Then we crash onto the desktop again like back in 1998.

    - Data Classes: Has existed in Java for ages and is called Bean there. Data classes in Kotlin are nothing more than beans that simply grab and hide their setters and getters. You can argue about which is better, I personally don't like Code Magic.

    - Smart Casts: nice that you save a few letters here, but as mentioned above: I'm not a fan of Code Magic.

    - Type Inteference: This is always hyped so that you don't have to specify a type. In JavaScript, a language where this has been possible since the beginning, everything is done to prevent this, because in larger projects it is a catastrophe and a frequent source of errors. So with Kotlin this is not an advantage but a disadvantage.

    - Functional programming: fully supported in Java since Java 8, so for 6 years. If you take Kotlin's official release date, Java can be functional for 2 years longer.

    In conclusion, Kotlin's advantages are reduced to a few tip supports.

  16. Re: Kotlin, the flop of the decade

    Author: apoth90 06.11.20 - 16:59

    twothe wrote:
    --------------------------------------------------------------------------------
    > - Type Inteference: This is always hyped so that you don't specify a type
    > must. In JavaScript, a language where this has been possible since the beginning, you do
    > just everything to prevent that, because in larger projects there is a
    > Disaster and frequent source of error. So that is not the case with Kotlin
    > Advantage but a disadvantage.

    Please answer the following: What happens if I execute the following piece of code in both Kotlin and JavaScript:
    var x = 5;
    x = "foobar"

  17. Re: Kotlin, the flop of the decade

    Author: pioneer 06.11.20 - 17:02

    apoth90 wrote:
    --------------------------------------------------------------------------------

    > Please answer the following: What happens if I have the following bit
    > Run code in both Kotlin and JavaScript:
    > var x = 5;
    > x = "foobar"

    :-D His skills will not be enough for that ;-)

  18. Re: Kotlin, the flop of the decade

    Author: d4rky1989 06.11.20 - 17:12

    twothe wrote:
    > - Type Inteference: This is always so hyped that you don't specify a type
    > must. In JavaScript, a language where this has been possible since the beginning, you do
    > just everything to prevent that, because in larger projects there is a
    > Disaster and frequent source of error. So that's not the case with Kotlin
    > Advantage but a disadvantage.

    I have to correct you there. You are confusing "Type Inference" with a "Static Typed Language". Attempts are currently being made to achieve the latter with the help of TypeScript. The former is only an aid to avoid boilerplate code (the (static) variable type is automatically determined by the compiler from the context). Without type inference, mMn. e.g. not to use lambas at all.



    Edited 1 times, last on 11/6/20 5:15 pm by d4rky1989.

  19. Re: Kotlin, the flop of the decade

    Author: Pete Sabacker 06.11.20 - 17:12

    twothe wrote:
    --------------------------------------------------------------------------------
    > - NullPointerExcptions are no "frustration for all programmers"
    > but only for beginners. Every better IDE also shows potential
    > NullPointer on, if you still program them in such a way that they occur
    > can.

    In reality you have people who are not careful. Since I've been using Kotlin and Swift on projects with other people, the number of these exceptions has dropped to almost zero because programs don't compile regardless of them.

    > - Coroutines: who somehow thinks coroutines are better than concurrent ones
    > Threads did not understand one or the other concept. Support for
    > Coroutines have existed in Java since 1.0 that no one has used them
    > Good reasons: there are much better options. The argument the Android
    > Being single-threaded and having coroutines benefits is just in
    > wrong in every way.

    Yes, that's why everyone loves coroutines, because threads are just always better.

    > - Checked Exceptions: with Kotlin I am allowed to expect program errors
    > just ignore it. Great! Then we crash back to the desktop like
    > then in 1998.

    So you can ignore nullability when the compiler complains, but not exceptions? Which, quite apart from that, were being abused far too much in Java anyway?

    > - Data Classes: has existed in Java for ages and is called there
    > Bean. Data classes in Kotlin are nothing more than beans that are plain
    > and grab their setters and getters to hide. One can argue about it
    > which is better, personally i don't like code magic.

    This is absolute nonsense or just a tiny fraction of what defines data classes:

    https://kotlinlang.org/docs/reference/data-classes.html

    > - Smart Casts: nice that you save a few letters here, but
    > As mentioned above: I'm not a fan of Code Magic.

    Yes, let's just clutter the code with all the snot because the Java type system is so great.

    > - Type Inteference: This is always so hyped that you don't specify a type
    > must. In JavaScript, a language where this has been possible since the beginning, you do
    > just everything to prevent that, because in larger projects there is a
    > Disaster and frequent source of error. So that's not the case with Kotlin
    > Advantage but a disadvantage.

    Uff.

    > - Functional Programming: fully supported in Java since Java 8, i.e. since 6
    > Years. If you take Kotlin's official release date, then you can
    > Java functional for 2 years longer.
    >
    > In conclusion, Kotlin's advantages shrink to a few tip supports
    > together.

    Double Uff.

  20. Re: Kotlin, the flop of the decade

    Author: andy848484 06.11.20 - 17:13

    I didn't understand the point of criticism either.
    Despite the type derivation, kotlin remains a static, strongly typed language.
    Especially with any generic list types where you break your fingers while typing in Java (type derivation)

  1. theme
  1. 1
  2. 2

New topic Change view


To comment, please log in or register. You must also go to your account profile under Forum have assigned a username. To the login

  1. akf bank GmbH & Co KG, Wuppertal
  2. ivv GmbH, Hanover
  3. UKV - Union Krankenversicherung AG, Saarbrücken
  4. Bechtle GmbH, Hamburg

Pure golem
  • Use Golem.de without advertising

  1. (including Razer BlackWidow V3 for 114.90 € including shipping)
  2. (including Outriders for € 35.49, Yu-Gi-Oh! Legacy of the Duelist - Link Evolution for € 11.99, The ...
  3. (including Resident Evil 7 for € 7.99, Shadow Warrior 2 for € 6.66, Assassin's Creed: Odyssey for ...
  4. (including AMD Ryzen 7 5800X 408.90 €, Intel Core i7-11700K 379 €, Samsung 970 Evo Plus 1 TB SSD 139 ...


Did we miss something?

Email to [email protected]


© 1997-2021 Golem.de. All rights reserved.