Java Language Update - Early 2024 Edition

Поділитися
Вставка
  • Опубліковано 17 лют 2024
  • This session discusses recent advancements in the Java programming language, and looks at what’s coming next.
    Presented by Viktor Klang (Oracle)
    Recorded at Jfokus 2024 ➱ www.jfokus.se
    More… ➱ inside.java/tag/amber
    Paving the On Ramp ➱ openjdk.org/projects/amber/de...
    Tags: #Java #OpenJDK #JDK #ProjectAmber
  • Наука та технологія

КОМЕНТАРІ • 38

  • @JanMichalSzulew
    @JanMichalSzulew 3 місяці тому +5

    Never heard of Viktor before, but he's my hero because of the Gatherers API.
    That being said Concise Method Bodies cannot come soon enough

    • @viktor_klang
      @viktor_klang 2 місяці тому +1

      Thank you for the kind words, Jan! Feedback on Gatherers is most welcome :)

  • @driveDoses
    @driveDoses 3 місяці тому +11

    Java is ruling from last 2 decade and it is gonna rule for next decade as well.

    • @ianmarteens
      @ianmarteens 3 місяці тому +2

      Java is pathetic. And True Believers are obnoxious.

    • @maximus1172
      @maximus1172 3 місяці тому +1

      Lol keep dreaming

    • @rathinaveluthiruvenkatam6203
      @rathinaveluthiruvenkatam6203 18 днів тому +1

      So it will die after 10 years?! Good prediction, perhaps a little optimistic!

  • @terribleprogrammer
    @terribleprogrammer 3 місяці тому +2

    Glad, Java language developers woke up! 🔥

  •  3 місяці тому +2

    Java is a powerful and versatile language that has been evolving rapidly in recent years. I am amazed by the new features and improvements that have been introduced, such as records, pattern matching, sealed classes, and more. However, I also recognize that Java is not the only language that has these capabilities. Many other languages, such as Kotlin, Rust, Go, and JavaScript, have been using similar or even more advanced concepts for a long time. I appreciate and respect the work of the developers and communities behind these languages, and I draw inspiration from them. I believe that being humble and open-minded is a good quality for any programmer, as it allows us to learn from each other and create better software. I would like some kind of mention of those languages, some comparative analysis and trade-offs

    • @TJ-hs1qm
      @TJ-hs1qm 3 місяці тому +1

      on the JVM Scala is defacto the benchmark for FP style programming and type theory . We already
      had ADTs and pattern matching 15 years ago 😅 It took everybody else to play catch.

    • @Andr805
      @Andr805 3 місяці тому +2

      ​@@TJ-hs1qm The only functional language on JVM is Clojure, Scala sits in between of FP and OOP.
      While Scala can be the benchmark for something, it has never gained popularity to become the next big thing. I remember in ~2016-18 everyone was talking about Scala, but it never got beyond just talks about how Scala is great.

    • @rathinaveluthiruvenkatam6203
      @rathinaveluthiruvenkatam6203 18 днів тому

      At last JDK team has experts in C, Python, groovy, Kotlin and Rust!

  • @feryadialoi2244
    @feryadialoi2244 3 місяці тому +1

    the pattern binding use flow-based scoping is interesting
    the first time I know it works when I inverted the if statement using Intellij,
    guess what? the Intellij once again is so amazing

  • @simonhartley9158
    @simonhartley9158 3 місяці тому

    For the AsyncResult, might we no longer have access to the cause or any suppressed exceptions from the InterruptedException?

  • @rathinaveluthiruvenkatam6203
    @rathinaveluthiruvenkatam6203 18 днів тому

    Tomorrow sometime you will have Java without mandatory class! Write functionally .Javac 'preprocessor(!)' will add boiler plate class wrapper! Python does it with ubiquitous 'main' module already. Like CPython behind Python, Cjava will be there, for 'fully' functional Java !

  • @user-pr1dy8he3m
    @user-pr1dy8he3m 2 місяці тому

    Highly informative video on programming language. Great for beginners!🤠

  • @rathinaveluthiruvenkatam6203
    @rathinaveluthiruvenkatam6203 18 днів тому

    At last JDK team has experts in C, Python and Rust!

  • @TheBigLou13
    @TheBigLou13 3 місяці тому +7

    35:33 I like it all, except that the first "&&" in a *composite* switch *condition* got renamed to "when".
    if, case, when... Will there be a "once" condition in the future?
    It's too much.

    • @TheBigLou13
      @TheBigLou13 3 місяці тому +4

      We're used to see "case" in switch statements out of tradition, but what if we simplify conditions and become more approachable and clear overall:
      String text = switch (value) {
      if 1 -> "one";
      if 2 -> "two";
      if 3 -> "three";
      if 4 -> "four";
      }
      See how clean it is? Lets try pattern matching with guards:
      switch (value) {
      if ValueClass v && v.range > 1 -> doSomething(v);
      if NonValueClass v -> {
      v.doSomethingElse();
      v.doThisAfterwards();
      }
      }
      THIS feels good.

    • @TheBigLou13
      @TheBigLou13 3 місяці тому +5

      To think even further ahead, if we're already on the topic of redefining switch - Why not leave out the "case" entirely:
      String text = switch (value) {
      1 -> "one";
      2 -> "two";
      3 -> "three";
      4 -> "four";
      }
      switch (value) {
      ValueClass v && v.range > 1 -> doSomething(v);
      NonValueClass v -> {
      v.doSomethingElse();
      v.doThisAfterwards();
      }
      }
      Or even shorter, if you dare to allow pattern instantiation and access in one:
      switch (value) {
      ValueClass v.range > 1 -> doSomething(v);
      NonValueClass v -> {
      v.doSomethingElse();
      v.doThisAfterwards();
      }
      }
      Which would allow neat things like this in a way more readable form:
      String text = switch (value) {
      Integer i "one or less";
      2 -> "two";
      3 -> "three";
      Integer i >= 4 -> "four or more";
      }
      Compared to how you'd currently have to write it:
      String text = switch (value) {
      case Integer i when i "one or less";
      case 2 -> "two";
      case 3 -> "three";
      case Integer i when i >= 4 -> "four or more";
      }

  • @pompiuses
    @pompiuses 3 місяці тому +3

    When does proper null safety come? It’s also clunky to model pure data without “free” functions (outside classes).

    • @TheBigLou13
      @TheBigLou13 3 місяці тому +2

      In regards to manual garbage collection / free: Yes, that could be a useful functionality to have.
      In regards to null safety: You can *always* do Optional.of(nullable).orElse("") or use primitive data types to never face a null value.
      Additionally you can make a variable final to enforce that a value gets set.

    • @donwinston
      @donwinston 3 місяці тому

      Good grief, just make a static class of functions.

    • @pompiuses
      @pompiuses 3 місяці тому

      @@donwinstonYes, that is the alternative. It essentially makes the class act as a package with functions. This would look much better and more intuitive with free functions and records inside a package.

    • @pompiuses
      @pompiuses 3 місяці тому

      @@TheBigLou13Using Optional in a data structure is bad and should be avoided. Some times null simply can’t be avoided. In these cases compiler support for null safety would be nice.

    • @maruseron
      @maruseron 3 місяці тому +2

      @@TheBigLou13 Optional is not a fully featured Option monad, and it desperately lacks the benefits of being modeled as an ADT. Moreover, it's not supposed to be used to store data, but as a return value to indicate possible absence - for implementers, the hassle of dealing with null is still pretty much real. A null aware type system is very desperately needed, specially for a language that picked nullability as a default.

  • @user-ij9vi6sn8g
    @user-ij9vi6sn8g 3 місяці тому +5

    Yo first commetn, tired of waiting for valhalla, lilliput.

  • @HuapinChiu
    @HuapinChiu 3 місяці тому +1

    User
    I was not convinced. Not very excited about the future.

  • @31redorange08
    @31redorange08 3 місяці тому

    The presentation was well-crafted until the pseudo-code slide at 44:36.

  • @gsestream
    @gsestream 3 місяці тому +1

    how about foundation classes for jvm and not the things the programmers can do with java, let the users do the java libraries, mostly, focus on the language platform. I mean hardware/os interface is the major part of java, not the user libraries. dont fall in the c++ std library rabbit hole. tools not the product, as you dont know what the end product will be. a library in wrong place does not help. its clutter.

    • @gsestream
      @gsestream 3 місяці тому

      one more: every non-array object should be considered as size one array for simple usability and syntax interop. I mean there should not be a single variable entities but only arrays, from zero to one to any size. or even if there is things like "int x=0;" then that x should be considered as "int[] x={0};" in all cases. in computer memory there is no such a thing as single variable, but a range of variable addresses which is always a memory range, array. sometimes more complex looking thing is more simple engineers keeping it simple.

    • @gsestream
      @gsestream 3 місяці тому

      why do you need "new" keyword, you would just do MyClass myclass = MyClass(), or int[] intarray = int[5];

    • @gsestream
      @gsestream 3 місяці тому

      both java and javafx (if using java window refresh system) seem to have jittery frame pacing that the translating camera rendering image flow becomes not very nice to look at.

    • @gsestream
      @gsestream 3 місяці тому

      why does a thread running completely separately from its starter and data induce hickups on a totally separate function in the same application. emphasis on the thread independency in all manners. there is no shared data being used, including window, other than same application main context. say the other thread is calculating some maths without direct contact to the other functionality, and still the thread affects when it should not. all swing related operations including main window dragging around will be lagged by same 0.5sec stutter.

    • @gsestream
      @gsestream 3 місяці тому

      java .jar files need module-path (not only class-path)

  • @rathinaveluthiruvenkatam6203
    @rathinaveluthiruvenkatam6203 18 днів тому

    So old Java is a poor language. Tomorrow this will be poor! Arrogant Old java bows, without honestly acknowledging, to Python, Groovy and venerable C (function pointer of C is method pointer of Java!!). Learn Python for all , Rust for System Work. Kotlin for android.

  • @BUY_YT_VIEWS_m060
    @BUY_YT_VIEWS_m060 3 місяці тому +2

    keep up the hard work