All Java 23 Features - Inside Java Newscast #70

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 106

  • @nhmarujo
    @nhmarujo 5 месяцев назад +20

    Hi Nicolai. Small correction, hope you don't mind - G1 isn't the real default Garbage Collector (as stated in ruclips.net/video/kzjGp7LmW0I/видео.html ). SerialGC might actually be chosen depending on CPU/memory available. It is not uncommon for people using containers, for instance, to have a setup on which the virtual machine has access to a low amount of resources and therefore SerialGC is picked. While that statement is somewhat close to the truth, it can be a bit misleading 🙂Cheers and thanks for all the nice work you guys do!

    • @kamurashev
      @kamurashev 5 месяцев назад

      Default means default. If you do not provide/choose any overrides it would go with g1.

    • @nipafx
      @nipafx 5 месяцев назад +9

      @@kamurashev No, he's right and I forgot about that when writing that line. There's no one default GC - the runtime will pick one based on CPU and memory. On non-ancient stand-alone machines (like dev machines), this will be G1, but on a restricted cloud instance, it may well not be.

    • @Lpx288
      @Lpx288 5 месяцев назад

      I was looking for this info the other day but didn't find any documentation. Do you have any link by any chance? Ty

    • @julianjupiter1995
      @julianjupiter1995 5 месяцев назад

      ​@@nipafx what is the case it will choose ZGC as the default one?

    • @billykorando
      @billykorando 5 месяцев назад +5

      @@Lpx288 It's not super clear, but it is covered under the ergonomics section in the GC tuning guide: docs.oracle.com/en/java/javase/22/gctuning/ergonomics.html#GUID-DA88B6A6-AF89-4423-95A6-BBCBD9FAE78, specifically the note about what the JVM considers to be a "server class machine"
      I mention it more specifically here: inside.java/2022/08/08/sip063/
      I think there was some discussion on changing those parameters to make Serial less frequently chosen... I'll need to check with the GC team on that.

  • @ingframin
    @ingframin 5 месяцев назад +62

    Valhalla and vector api are really needed for physics and engineering computing. I know we are a small market but please! Finish them already!

    • @sjzara
      @sjzara 5 месяцев назад +3

      I agree!

    • @lmj5994
      @lmj5994 5 месяцев назад +7

      Valhalla is needed for any performance intensive processing, not just physics or engineering. I am an ex-physicist now working in information processing and I need Valhalla to reduce the number of effectively random memory lookups. I have numerous small objects that are good candidates for conversion to a value type. Being value types would avoid at least one memory access. Sometimes these are nested with the enclosing type remaining small, so two or more (random) memory accesses in that case. And I have numerous arrays and lists (of arrays) where the entries are good candidates for value types, and hash maps where the keys can be converted to value types. Valhalla will make a massive difference to almost any program with a lot of memory access or a lot of use of small types.

    • @sjzara
      @sjzara 5 месяцев назад +1

      @@curio78 It’s the way I used to program Fortran in the 80s.

    • @nipafx
      @nipafx 5 месяцев назад +9

      I agree, but keep in mind that progress isn't slow because of a lack of effort. It's slow because the situation and solution are very complex, which is further complicated by the goal to expose as little as possible of that complexity to us developers.

    • @sjzara
      @sjzara 5 месяцев назад +5

      @@curio78 This is a huge exaggeration. Java has been used for high-performance and numerical work for a long time. The Java NAG library has been available for decades. Valhalla and universal generics aren’t showstoppers by any means. What they will allow is for very high performance numeric code to be written in a clear OOP manner that can be fully optimised by hotspot. It will make high-performance numeric code easier to write in Java than in Fortran or C/C++. Java can take its rightful place as the language that scientists and engineers and statisticians should be using to write apps and libraries. It could revolutionise the way numeric code is written and maintained.

  • @iheanyichukwuaguwa6231
    @iheanyichukwuaguwa6231 4 месяца назад

    Thanks guys! This is super awesome. We, the educators, asked and you listened. With the new modifications to the implicitly declared classes and the automatic imports of java.util, java.math and most importantly of the extremely handy static methods in the new IO class, it's time to revert to teaching introductory programming courses with our beloved Java.

  • @lmj5994
    @lmj5994 5 месяцев назад +8

    Another excellent (informative) video thank you Nicolai

    • @nipafx
      @nipafx 5 месяцев назад

      Thank you! 💙🧡

  • @AndrewMalyhin
    @AndrewMalyhin 5 месяцев назад +1

    The best informative newscast about java

  • @El-barto1
    @El-barto1 3 месяца назад

    THIS ALL IS AWESOME EXCEPT FOR THE STRING TEMPLATE PART!!!

  • @jediikk
    @jediikk 5 месяцев назад +23

    String templates removal is truly disappointing. A feature that is such a quality of life improvement and that is present in almost every popular language for at least a decade. Sad.

    • @Kroppeb
      @Kroppeb 5 месяцев назад +8

      It's not gonna be removed forever, they just need more time to change how they are implemented into the language

    • @nikitamyazin6586
      @nikitamyazin6586 5 месяцев назад +15

      @@Kroppebyep. It’s only going to take 5-10 more years, no big deal

    • @prdoyle
      @prdoyle 5 месяцев назад +3

      Yeah, I'm looking forward to Nicolai's video explaining why it was removed.

    • @SLTRM
      @SLTRM 5 месяцев назад

      Kotlin rulez baby!!!

    • @nikitamyazin6586
      @nikitamyazin6586 5 месяцев назад

      @@IfeSunmola which part of the reasoning made sense? 🤔

  • @personalaccount1515
    @personalaccount1515 5 месяцев назад

    Excellent video, THX!

  • @sblantipodi
    @sblantipodi 3 месяца назад

    Hi there. Is there some news on the Vector Api? When they will exit the incubation state? I put a lot of effort to use them in my program and they are devastating on some loads with CPUs that supports AVX512. My concern is that I'll need to rewrite everything for API changes when the APIs will exit the incubator state. I have some "development questions" on those APIs, are there a mailing list where to discuss about the use and the benefit of those APIs?

  • @forKotlinsky
    @forKotlinsky 5 месяцев назад +3

    You gotta believe in Valhalla with Me

    • @nipafx
      @nipafx 5 месяцев назад +1

      I do!

  • @df658f02
    @df658f02 5 месяцев назад

    If you want to advance in Java from basic to intermediate and advanced subjects, what are the best courses that exist at a reasonable price? Do you have any recommendations?

  • @FABGIO1
    @FABGIO1 5 месяцев назад +2

    Why String templates jep has been dropped?

  • @Andre-jj6xs
    @Andre-jj6xs 5 месяцев назад +2

    😂 6:08 no pressure Brian, but WHEN WILL IT COME?

  • @CliqueSpace
    @CliqueSpace 5 месяцев назад

    Hello. One feature of the new way statements can appear before a call to super in a constructor that seems a bit worrying to me is the assignment of fields.
    A great thing seems to be the capacity to validate parameters and do other checking in calls to constructors before calling super and hence before memory is allocated to the object being constructed. If one can set fields in a call before super, will this interfere with how this seems?

    • @CliqueSpace
      @CliqueSpace 4 месяца назад

      Perhaps I taking to myself, but still, perhaps assigning fields is fine because they will be made available to a presumptive "this" only after the call to super.
      I think allowing statements before a call to super has a potential to be a very good thing for Java.

  • @douglasfugazi
    @douglasfugazi 5 месяцев назад

    Thanks 🎉

  • @lapissea1190
    @lapissea1190 5 месяцев назад +1

    I am really not looking forward to the memory access removal. Maybe I'm lacking some knowledge here but for example. Here is a very simple library. There is a class called FormatToString that simply takes an annotation from the class and converts it in to a toString function. Eg: "Foo{bar: #bar}" Now the user clearly intends the bar field/accessor to be used but it may not want to publicly expose as it may just be something related to string display. Without the memory access that contract can no longer be fulfilled and the user must manually allow the library to access things via reflection what defeats the purpose of something that is supposed to make things simpler and faster to write.

    • @nipafx
      @nipafx 5 месяцев назад

      Using memory access to read fields can break on any minor Java update, on other JVMs, even when everything else stays the same, it could theoretically break non-deterministically when some run-time optimization lays out fields differently. This is a terrible use of that capability and that any random dependency of a dependency of a dependency can silently break an app's integrity like that is kinda bonkers. So it's good that it goes away.
      If the library used bytecode generation or reflection instead, users can unlock the capability with a simple command line flag and thus acknowledge that they accept the compatibility risk.

    • @lapissea1190
      @lapissea1190 5 месяцев назад

      I mean I'm for removing unsafe when there is a suitable alternative (with the edge case of tight performance requirements)
      For example, the byte[] primitive access by offsets has a var handle alternative and it is really good. But for things such as fields, obtaining a var handle can be a large pain or just impossible without unusual permissions. I'm all for unsafe removal if it can be replaced. Currently and sadly, that is not the case and while it is much better than it used to be, it's not quite there yet.

    • @nipafx
      @nipafx 5 месяцев назад +1

      @@lapissea1190 You missed (or at least didn't reply to) the central part of the rationale: It doesn't matter how useful it is, *nothing* should be able to undermine an application's integrity unless the people running it give explicit permission.

    • @lapissea1190
      @lapissea1190 5 месяцев назад

      Oh apologies! Yes but it's also more than unsafe? It might just be my forte in to 3d graphics but almost all causes of crashes in my experience are not related to unsafe but loading of external code. Something that is very much allowed and requires no explicit permissions.

  • @enaltogondrige
    @enaltogondrige 5 месяцев назад

    Thanks

  • @CraccaHacka
    @CraccaHacka 5 месяцев назад

    Would it be possible if anyone did the work to backport the Markdown Javadocs to JDK21?

  • @kamurashev
    @kamurashev 5 месяцев назад +7

    Omg it’s so disappointing those string templates. We need this thing

    • @squidxtv
      @squidxtv 5 месяцев назад +14

      It is not really disappointing, it will most likely come back. I want a properly designed feature instead.

    • @kamurashev
      @kamurashev 5 месяцев назад +1

      @@squidxtv I need it yesterday or the day before that

    • @zombi1034
      @zombi1034 5 месяцев назад

      @@squidxtvYes but when… JDK 30😢?

    • @DinMamma002
      @DinMamma002 5 месяцев назад +6

      I think the "STR" prefix on string template were to much bloat. I rather see a redesign.

    • @squidxtv
      @squidxtv 5 месяцев назад

      @@DinMamma002 yeah exactly, imo it's not necessary to reinvent the wheel with this. Just look at other languages, how they approach this.

  • @advsaifkhan8938
    @advsaifkhan8938 5 месяцев назад

    If at least something would be available for string templating in Java, say, like compact() in PHP laravel.
    Though, with String.format(), I can achieve enough which I want. but it could be probably simplified with the approach like compact(). Probably it could be achieved when project Babylon will stand and jump.

  • @ram0973
    @ram0973 3 месяца назад

    What about a nulls native support, like in C# and Kotlin. ?.

  • @PeterAdiSaputro
    @PeterAdiSaputro 5 месяцев назад +1

    Hi Nicolai.
    Is OpenJDK and JDK have the exact same features and source codes ? Who determines what new features will be added, what old features will be fixed, and what old features will be removed (deprecated) in newer versions of the JDK, is it the community or the internal Java team at Oracle ?

    • @tintifax8531
      @tintifax8531 5 месяцев назад +1

      OpenJDK is "the JDK". This is where Java is developed.

    • @Anbu_Sampath
      @Anbu_Sampath 5 месяцев назад

      OpenJDK is the place Java developed, vendors can add features and release build of OpenJDK.

    • @PeterAdiSaputro
      @PeterAdiSaputro 5 месяцев назад

      @@Anbu_Sampath Vendor = Oracle ?

    • @Anbu_Sampath
      @Anbu_Sampath 5 месяцев назад

      @@PeterAdiSaputro Oracle, Redhat, Amazon, Microsoft etc.

  • @KleyderReyes-bu1iv
    @KleyderReyes-bu1iv 5 месяцев назад

    👍

  • @redcrafterlppa303
    @redcrafterlppa303 5 месяцев назад

    3:15 so import module is basically using namespace from c++... I'm not sure I like it.

  • @Anbu_Sampath
    @Anbu_Sampath 5 месяцев назад

    5:52 - like ir. Valhalla - every avoids except Java Developer.

  • @ahmedurmiteahmedurmite3711
    @ahmedurmiteahmedurmite3711 5 месяцев назад +2

    wake me up when valhalla it will be here, 10 years is too long, the development is too slow, and java have lost a lot of ground compared to the other language

  • @sjzara
    @sjzara 5 месяцев назад +2

    String templating always seemed to be a strange addition to Java. One of Java’s great strengths is compile-time checking and code analysis, which is broken by string templating. Templating also adds new syntax to be handled by transpilers. I hope it isn’t added back. Its function can be replaced by combinations of string formatting and lambdas. Keep functionality and variable names as pure Java!

    • @askarkalykov
      @askarkalykov 5 месяцев назад +1

      I always find myself trying to use them for something more than a string template, and always get reminded about inherently String-bound nature of TemplateProcessors.

    • @31redorange08
      @31redorange08 5 месяцев назад

      String formatting is compile-time checked?

    • @sjzara
      @sjzara 5 месяцев назад

      @@31redorange08 No, but the use of variables and expressions as parameter for the formatting is.

  • @aleksander_2137
    @aleksander_2137 5 месяцев назад +2

    String Template removal has come as shock to me being honest

    • @VuLinhAssassin
      @VuLinhAssassin 5 месяцев назад

      Yeah, I am not expecting it

    • @VuLinhAssassin
      @VuLinhAssassin 5 месяцев назад

      Once again, we can only dream of String interpolation from other languages

    • @lucaguadagnini8512
      @lucaguadagnini8512 5 месяцев назад +2

      it's temporary, they will come back with a finer and better syntax

  • @aecbnas2112
    @aecbnas2112 5 месяцев назад +1

    Valhalla’s progress toooooo slow。

  • @hba6018
    @hba6018 5 месяцев назад +4

    The decision to remove string templates has been extremely misguided, very very sad. I still don't understand the justification.

    • @dino130395
      @dino130395 5 месяцев назад +2

      They figured out that they don’t need special syntax to achieve the optimizations they wanted. New syntax should always be avoided if at all possible to reduce bloat in the language. Since they can achieve the same performance without it, they need to completely redesign the api for that feature. It will be back, they just removed it since it makes no sense to keep it as preview knowing it will be changed completely

  • @thanosfisherman
    @thanosfisherman 5 месяцев назад +4

    Give us Valhalla already wtf is wrong with you.

    • @lucaguadagnini8512
      @lucaguadagnini8512 5 месяцев назад

      chill, man! 😂 don't you know how hard it is to bring such a feature?

    • @thanosfisherman
      @thanosfisherman 5 месяцев назад +1

      @@lucaguadagnini8512 No I don't

    • @thanosfisherman
      @thanosfisherman 5 месяцев назад

      @@lucaguadagnini8512 I mean they've been working on it for more than 10 years wtf. C# has value type from day 1

  • @Drekrosh
    @Drekrosh 5 месяцев назад +2

    Lol, he’s so excited about the new JDK 23 when Java is already irrelevant in the world. You should be thinking not about the 1% of people who use the new version, but about those who can’t afford to use the new features in the older versions of the language. Enterprise is stuck on version 8 and can’t afford to use your innovations. Nobody starts new projects in Java anymore; everyone is using more reliable and modern languages like Golang for backend or Rust. When enterprise wants to get rid of legacy, they choose Golang over Java, and there are dozens of such examples. Someone please tell Oracle and the author of the video that it’s not the year 2000, good morning. Nobody needs their dinosaur with tons of junk inside that they can never get rid of. Just keep making your JVM, the only thing that can be useful. No project Valhalla or any other will save this language from falling into the abyss; Cobol will have a neighbor at the bottom.
    New logo for Oracle -> 🤡 (clown)

    • @just-me-and-code
      @just-me-and-code 5 месяцев назад +10

      I use java, it's been a year now and it's great🙃

    • @JoeMwangi
      @JoeMwangi 5 месяцев назад +9

      You cared so much that you had to comment. It means probably java is opposite to what you say.

    • @just-me-and-code
      @just-me-and-code 5 месяцев назад +2

      @@JoeMwangi😂 good response

    • @vinterskugge907
      @vinterskugge907 5 месяцев назад +6

      This 'stuck on Java 8' thing isn't as relevant anymore. I have been using Java 21 on a daily basis since November.
      If you look at the 'show of hands' the presenters are doing at conferences, fewer and fewer are still on Java 8.

    • @cosmowanda6460
      @cosmowanda6460 5 месяцев назад +3

      Bro is clearly a go fan boy but he's on every java video lmao

  • @ekadet7882
    @ekadet7882 5 месяцев назад +2

    Say "gatherer" 3 times in a row and you will understand why it is such a poor name. A more concise, and intuitive name like "pipe" would be much more fitting, imho.
    Stream.of(1, 2, 3).pipe(🍄=> collect(🍄)).toList();