Funny story, friend and I were just talking last night about how Java 8 is still used everywhere.

  • KaladinStormblessed@lemm.ee
    link
    fedilink
    arrow-up
    15
    ·
    21 hours ago

    I feel like this article was written by an llm? The way it skips around and makes unnecessary comparisons to JavaScript, the jump from the very beginning to very recent changes, it’s all just weird. It feels like it’s saying nothing but talking a lot

    • u_tamtam@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      11 hours ago

      That’s why it should be made compulsory to indicate when something was produced, even partially, by an AI. This time of your life you spent reading some low-effort no-value bullshit you will never get back, and neither will the hundreds/thousands others who read it. This is a net loss for humanity.

  • GissaMittJobb@lemmy.ml
    link
    fedilink
    arrow-up
    21
    arrow-down
    1
    ·
    1 day ago

    Moving to Kotlin taught me to appreciate the underlying fundamentals in the JVM and the patterns present in Java.

    I’d rather not use Java today, though. Kotlin is basically Java but with the best practices enabled by default and the bad parts made impossible at a language level.

    • abbadon420@lemm.ee
      link
      fedilink
      arrow-up
      3
      ·
      1 day ago

      I need to know more. What are the bad parts that are disabled? Which best parties are enabled at the language level?

      • chaos@beehaw.org
        link
        fedilink
        arrow-up
        4
        ·
        2 hours ago

        Yeah, they’re probably talking about nulls. In Java, object references (simplified pointers, really) can be null, pointing nowhere and throwing an exception if you try to access them, which is fine when you don’t have a value for that reference (for example, you asked for a thing that doesn’t exist, or you haven’t made the thing yet), but it means that every time you interact with an object, if it turns out to have been null, a null pointer exception is getting thrown and likely crashing your program. You can check first if you think a value might be null, but if you miss one, it explodes.

        Kotlin has nulls too, but the type system helps track where they could be. If a variable can be null, it’ll have a type like String?, and if not, the type is String. With that distinction, a function can explicitly say “I need a non-null value here” and if your value could be null, the type system will make you check first before you can use it.

        Kotlin also has some nice quality of life improvements over Java; it’s less verbose (not a hard task), doesn’t force everything to belong to a class, supports data classes which are automatically immutable and behave more like primitive values than objects, and other improvements.

      • Tony Bark@pawb.socialOP
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        1
        ·
        edit-2
        1 day ago

        For one thing, the file and class name must be the same. While it is good practice, making it mandatory requirement limits flexibility.

  • cool@lemmings.world
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    30
    ·
    1 day ago

    After using Rust, I struggle to find a use-case for Java.

    We have Python for the bad programmers.

    • jecxjo@midwest.social
      link
      fedilink
      English
      arrow-up
      9
      ·
      22 hours ago

      As a programming language polyglot, currently using Java for backend services, one of the biggest reasons to use Java is due to the ecosystem. Hardened libraries for web frameworks and everything else under the sun means you have confidence in the language. You have millions of instances running in the wild so detection of issues are found and resolved quickly, corporations backing security audits and a lot of funding to make really good libraries.

      I hate the language itself and would never choose it as a language for a hobby project, but i completely understand why Java exists and thrives.

        • jecxjo@midwest.social
          link
          fedilink
          English
          arrow-up
          2
          ·
          7 hours ago

          I tend to find languages that are best of feature. If i need a fault tolerant, quick to continue service I’d probably pick Erlang or Elixir. If i need meta programming I’m going with Racket or Haskell. If i need a quick and dirty graphical tool for internal use only I’m writing it in tcl/tk or python/tk. If it’s system code I’m using C and Assembly.

          The problem i have with Java is outside of Android development I never have the use case i have at my corporate job. There we need a widely know language (so we can hire) that is used in a lot of web services (highly tested and bugs caught early and very visible) that has a diverse ecosystem (less custom built code). None of those attributes are needed in my hobby work.

      • cool@lemmings.world
        link
        fedilink
        English
        arrow-up
        5
        arrow-down
        5
        ·
        17 hours ago

        Hardened libraries

        Like log4j?

        Ecosystems matter for sure, but any java “killer library” should be usable by other programming languages.

        • jecxjo@midwest.social
          link
          fedilink
          English
          arrow-up
          2
          ·
          7 hours ago

          What language doesn’t have its worts? My point is that Java is the defacto corporate service language so if that’s what you’re doing chances are the libraries you’re using are also being used at FAANG or Fortune 500 companies who will spend the money to vet libraries, bug bounties and pay developers to escalate issues. If you pick a language that has no substantial use in your given field you won’t get the same visibility.