Modern Java in Action

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024
  • Let's write a GitHub Crawler and let's throw in everything Java (21) has to offer:
    ◦ virtual threads and structured concurrency,
    ◦ pattern matching and data-oriented programming,
    ◦ type inference, records, and sealed types,
    ◦ text blocks and template strings,
    ◦ a modern HTTP client and improved collections,
    ◦ modules and OS-specific binaries.
    The end result will look very different from just a few years ago, let alone 10. This is not your dad's Java!
    Presented by Nicolai Parlog (Oracle)
    Recorded at Jfokus 2024 ➱ www.jfokus.se
    ◦ Inside.java ➱ inside.java
    ◦ Dev.java ➱ dev.java
    Tags: #Java #JDK #OpenJDK

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

  • @TheBigLou13
    @TheBigLou13 7 месяцев назад +14

    20:00 I would be interested in a dedicated video to these reflection capabilities.
    Great talk/presentation, showing a lot of the new features in a connected way while also giving some additional information about them and their usages/options/capabilites/benefits!

    • @nipafx
      @nipafx 7 месяцев назад +3

      That dedicated video is not a bad idea, I'll put it on the list. 😊 If you want to look into it yourself, check out Class::getRecordComponents: docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Class.html#getRecordComponents()

  • @javaRelated
    @javaRelated 7 месяцев назад +8

    Thanks Nicolai, Great Talk as expected.

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

      Thank you!

  • @c00ckiez
    @c00ckiez 7 месяцев назад +2

    Banger video, love coding sessions like this. Keep it up!

  • @ihor_1995
    @ihor_1995 7 месяцев назад +4

    Great video! Thanks, Nicolai!

  • @jfkwasnoscope
    @jfkwasnoscope 6 месяцев назад

    Good talk Nicolai, love the frequent uploads on the channel.

  • @nuclearscissors
    @nuclearscissors 7 месяцев назад +2

    Great talk! Loved the structured concurrency bit, pattern matching (blew my mind a few times in the talk with how awesome the code looks with it), string templates and other new features overall. Java 21 has really upped it's game in terms of neat tricks that make the life easier.

  • @edgardcz
    @edgardcz 7 месяцев назад

    KUDOS! Awesome presentation! and remarkable job from the Java team!
    Please guys, bring the null check with ? and something similar to elvis operator to the lenguage!

  • @stefumies
    @stefumies 2 месяца назад

    Great presentation, and what a lovley theme, what is it and which font?`Its crisp and clear

  • @prdoyle
    @prdoyle 7 месяцев назад +6

    30:42 - RIP string templates

  • @asd-xr9ii
    @asd-xr9ii 7 месяцев назад +6

    Great, thanks!

  • @andmal8
    @andmal8 7 месяцев назад +3

    Thank you!

  • @gioeffectpro
    @gioeffectpro 23 часа назад

    How is your intelij idea so smooth?

  • @muzzletov
    @muzzletov 7 месяцев назад

    i used ktor for that exact purpose. i feel like, oracle took a lot of inspiration from kotlin.

  • @prdoyle
    @prdoyle 7 месяцев назад +1

    Great talk!
    Editor - looking at Nicolai is cool and all, but you need to keep showing the code or we can't follow along.

    • @nipafx
      @nipafx 7 месяцев назад +3

      I agree! But the video was edited live at Jfokus (for their live stream) as you see it here and we don't have access to the original source files to re-edit. 🫤

  • @octaviantheodor
    @octaviantheodor 7 месяцев назад

    Super lovely, thanks! But "abusive," indeed :) Imagine handling a new type of GH page... How many switch-es were there?

    • @nipafx
      @nipafx 6 месяцев назад +3

      That's not the abusive part, though. 😉 If every switch were instead a method on `Page`, adding a new type of pages requires you to implement all operations. If `Page` used the visitor pattern, adding a new type of pages requires you to update all visitors (i.e. operations). Here, adding a new type of pages requires you to update all switches (i.e. operations). There's no escape from this (unless you want some operations to execute a default action for all new types that are ever added).

    • @octaviantheodor
      @octaviantheodor 6 месяцев назад

      Fair enough :)

  • @hoo5886
    @hoo5886 7 месяцев назад +3

    awesome

  • @dmitriimoldavanov4701
    @dmitriimoldavanov4701 7 месяцев назад

    36:04 Pretty.pageList -> what if page is null? Should we put additional check for that?

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

      You can just add a `case null ->` to the switch if you want to handle that case. Otherwise the switch will throw a NullPointerException.

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

    good job, friend

  • @hba6018
    @hba6018 Месяц назад

    30:42 Beautiful String Templates that were not appreciated.

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

    Is Java modern COBOL ?

  • @rahulvijay1781
    @rahulvijay1781 7 месяцев назад +4

    I have 1yr of experience as a java developer..after i see this video makes me think i am a joke 🤡

    • @nipafx
      @nipafx 7 месяцев назад +6

      Don't think that. A year of experience is a great point to be productive and to really start to understand the language and its ecosystem. Stick with it! And keep in mind that the talk was prepared and rehearsed with the express goal to make the code look good.

    • @JamesStansell
      @JamesStansell 7 месяцев назад +1

      Everyone has to start somewhere! One thing about programming is that there is always more to learn ⭐

    • @rahulvijay1781
      @rahulvijay1781 7 месяцев назад +1

      Thankyou guys it means a lot ♥️

    • @thiagogeisler8715
      @thiagogeisler8715 7 месяцев назад +1

      @@nipafx Hello, Nicolai. You could consider taking the JAVA team to open a project to research a deterministic memory management system to be used by developers who need low memory consumption and develop real-time systems. I have seen some languages ​​that have adopted deterministic memory management, such as MOJO, Rust, Swift, and NIM. Nim, for example, adopts a system called ORC. It's just that some of us didn't want to have to leave this wonderful JAVA ecosystem for any other language, not even temporarily to make system-level applications.

    • @silentprotagonist3786
      @silentprotagonist3786 7 месяцев назад

      ​@@nipafx I just started learning Java seriously a week ago and this lowkey gives me hope 😹

  • @BrazenNL
    @BrazenNL 7 месяцев назад +3

    12:10 `git eradicate`?

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

      I'll have to look up the exact alias, but what it does is revert all changes and delete all untracked files.

    • @BrazenNL
      @BrazenNL 7 месяцев назад +3

      @@nipafx Oh, right, an alias. 🤦

  • @DamLee88
    @DamLee88 7 месяцев назад

    great!

  • @badpotato
    @badpotato 7 месяцев назад +1

    nice viewo

  • @yonishachar1887
    @yonishachar1887 Месяц назад

    22:26 - I hate when tutorials show how to do stuff and then say "super simplified", what exactly is simplified here?

    • @nipafx
      @nipafx 7 часов назад

      I go into it a bit starting at 22:00: You can configure all kinds of request settings and you can briefly see a few options in the popup at 22:08. So "simplified" in the sense that this specific project needed no extra configuration because the defaults all work - something that may not be the case in a real-world application.

    • @yonishachar1887
      @yonishachar1887 9 минут назад

      ​@@nipafx Thanks a lot for the explanation. I'm interested to know what would a real-world application configure as well besides Proxy if it's a web scraper.

  • @iogilarb
    @iogilarb 7 месяцев назад

    Haa... Java

  • @jfkwasnoscope
    @jfkwasnoscope 6 месяцев назад

    The string interpolation is still super ugly and should be replaced and yes I read the explanation for this incredibly unpractical and ugly design in the jep. It's not just a "small amount of convenience" that we're missing out on.

  • @AnimatedV
    @AnimatedV 7 месяцев назад +2

    These highly professional people have no concept of quality screencasts, do they? The wastage of time in Java community is like no other. Untangling complexities too remains elusive.

  • @krellin
    @krellin 7 месяцев назад +2

    records immutable = bad
    copyOf just to make immutable list = bad
    we had better solutions for all of this long time ago

    • @avalagum7957
      @avalagum7957 7 месяцев назад +6

      Could you please tell us what, you think, is better?

    • @krellin
      @krellin 7 месяцев назад +3

      @@avalagum7957 sure, records forcing you immutability is bad because for most it means boilerplate code, shit performance (no resue from cpu caches after you mutate) lots of garbage (which is less of a problem, cos gcs are very good these days)...
      what they should have done is give you options, if you want immutable declare your fields as val or var like kotlin...
      immutability is very niche technique that mostly library devs should use not general public... good example is string, more good examples? hard to come by

    • @krellin
      @krellin 7 месяцев назад

      @@avalagum7957 copyOF sucks, because it actually will copy unless underlying was immutable already... instead kotlin solved it better yet again... List = Immutable version, no mutator methods, MutalbeList = MutableVersion....
      You can simply return List even though underlying is mutable (so you do a free downcast)... and if a developer goes out of his way to cast it back to mutable and mutate it then its his problem...
      Again they are lazy and dont do the work even though jetbrains showed them years ago how its done properly.

    • @krellin
      @krellin 7 месяцев назад

      @@avalagum7957 if records were some sort of C type data structures packed in memory i would understand immutability, because you cannot predict length of some fields to count pointers... but all it does is forces you to use immutable pojos... why tf would you force it, i dont know...
      My only guess is laziness + since they are in the a cloud provider club, they do not want you to write efficient software that does more with less...
      This code looks like shit, and i didnt watch further.
      As a java dev it pisses me off that they make short sighted decisions to hit their 6 month schedule, even when good tested solutions to these problems are already out there for many years.

    • @cosmowanda6460
      @cosmowanda6460 7 месяцев назад +11

      ​@@krellinyou're right, records force immutability. But isn't that what they were created for?
      If you want to modify your classes everytime, then records are clearly not what you should use.
      If the jvm works like any other language though, anything that's immutable should help the compiler make more optimization.
      val and var isn't the good example you think it is. They could have used literally any other names that didn't look so identical.
      If I remember Kotlin correctly, its concept of immutability is also similar to java in that the reference is still mutable. So val in Kotlin, is really just final in java.

  • @hersh2
    @hersh2 7 месяцев назад +2

    why intellij? eclipse is better for java

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

      😂😂😂

    • @mSierraEngineer
      @mSierraEngineer 7 месяцев назад +1

      😆😆Hell nahh

    • @silentprotagonist3786
      @silentprotagonist3786 7 месяцев назад +1

      The choice of IDE doesn't matter bro

    • @meilyn22
      @meilyn22 7 месяцев назад

      Eclipse is better than Intellij? You must be from another planet to believe that.

    • @hersh2
      @hersh2 7 месяцев назад

      @@meilyn22 no, why? i like the workspace concept in eclipse more. also the content assist and hovers are much better. also intellij is not building incrementally, making it slow if i run the program. because it then starts compiling. when i delete a method, the other class which is not open and where the usage of the method is, will not be marked red in the file explorer. this is really unacceptable. intellij is for beginners imo.