- 194
- 71 570
Tales from the jar side
United States
เข้าร่วมเมื่อ 17 ธ.ค. 2022
I'm Ken Kousen. I have entirely too much academic training (two BS degrees from MIT, an MA and a Ph.D. from Princeton, and an MS from RPI), I'm the author of six technical books about Java, Groovy, Kotlin, Android, Gradle, and Mockito, I've given talks at conferences all over the world, and I have 25+ years of experience in Java and related topics. Let me help you understand what's important in the IT world and what isn't.
"Tales from the jar side" is a pun on (1) The Far Side cartoons by Gary Larson, and (2) how Java applications are delivered as "jar" (Java archive) files. It's about my continuing Java journey. Lame, sure, but I'm committed to it now.
By the way, my last name is pronounced "cousin", like the relative, even though it doesn't look like that.
Thanks for visiting!
"Tales from the jar side" is a pun on (1) The Far Side cartoons by Gary Larson, and (2) how Java applications are delivered as "jar" (Java archive) files. It's about my continuing Java journey. Lame, sure, but I'm committed to it now.
By the way, my last name is pronounced "cousin", like the relative, even though it doesn't look like that.
Thanks for visiting!
Secrets of Perplexity AI API Citations Revealed
Accessing and Integrating Perplexity AI API Citations in Python and Java
In this episode of Tales from the Jar Side, host Ken Kousen explains how the recently updated Perplexity AI API now includes citations for responses. He demonstrates how to access and use this feature in Python and Java, highlighting the differences and challenges in each language. Viewers will learn how to modify Python scripts using the OpenAI library and transform Java code to handle the new citations block using Java records, the included HTTP client, and Google's Gson. The episode covers important steps like setting up the HTTP client and requests, parsing JSON data, and accessing the elements you need.
00:00 Perplexity AI's Best Feature
00:26 Overview of the Channel and Host
00:47 Exploring the Perplexity AI API
02:18 Python Implementation of Perplexity API
04:59 Java Implementation of Perplexity API
08:55 Creating Java Records for API Mapping
10:46 Building the Perplexity Service in Java
12:29 Testing the Java Implementation
15:05 Conclusion and Future Videos
In this episode of Tales from the Jar Side, host Ken Kousen explains how the recently updated Perplexity AI API now includes citations for responses. He demonstrates how to access and use this feature in Python and Java, highlighting the differences and challenges in each language. Viewers will learn how to modify Python scripts using the OpenAI library and transform Java code to handle the new citations block using Java records, the included HTTP client, and Google's Gson. The episode covers important steps like setting up the HTTP client and requests, parsing JSON data, and accessing the elements you need.
00:00 Perplexity AI's Best Feature
00:26 Overview of the Channel and Host
00:47 Exploring the Perplexity AI API
02:18 Python Implementation of Perplexity API
04:59 Java Implementation of Perplexity API
08:55 Creating Java Records for API Mapping
10:46 Building the Perplexity Service in Java
12:29 Testing the Java Implementation
15:05 Conclusion and Future Videos
มุมมอง: 283
วีดีโอ
AI vs Cthulhu: How to Bypass Guardrails
มุมมอง 93521 วันที่ผ่านมา
In this episode of 'Tales from the Jar Side,' we embark on a humorous and fascinating journey into the world of H.P. Lovecraft. Using various AI tools and models like Google's Gemini, GPT-4o, Claude AI, and more, we attempt to discover the fictional incantation to summon Cthulhu. The episode discusses the interplay between AI, fiction, copyright laws, and interpretations of Lovecraft's mythos. ...
Perplexity API: Real-time Search Cheaper Than OpenAI
มุมมอง 83028 วันที่ผ่านมา
In this episode of Tales from the Jar side, Ken Kousen explores Perplexity AI's new API, both with Python and Java. Perplexity AI is an innovative search engine offering real-time web access, source citations, and an ad-free experience. Ken provides a comprehensive overview of using Perplexity's new programmatic API, including a Python demo and a comparison with OpenAI's tools. The video also d...
Discover Flux 1.1 Pro with Kotlin Magic!
มุมมอง 221หลายเดือนก่อน
Join Ken Kousen in this episode of Tales from the Jar Side as he dives into the world of AI image generation using the Flux 1.1 Pro API. This comprehensive guide details how to interact with the API using Kotlin, covering environment setup, generating images, handling data classes, and Kotlin flows. Learn to leverage Kotlin’s asynchronous operations for polling results and saving images with un...
Unveiling Java Power: The New Flux 1.1 Pro AI Image Generator
มุมมอง 380หลายเดือนก่อน
Explore the new AI image generator, Flux 1.1 Pro by Black Forest Labs. Learn how to access this powerful tool using Java before frameworks catch up. Discover the details of the beta API, cost efficiency, and process to generate images programmatically. Ken guides viewers through creating accounts, managing requests, and polling for results. Gain insight into Java coding techniques like validati...
Unlocking Kotlin: Dive into Classes, Interfaces & Inheritance
มุมมอง 2602 หลายเดือนก่อน
Dive into the world of object-oriented programming in Kotlin as we explore classes, interfaces, and inheritance. We compare Kotlin's features with Java, delving into the Kotlin documentation to understand primary and secondary constructors, visibility modifiers, and initializer blocks. Discover how to define properties and create constructors, both primary and secondary. Learn about abstract cl...
Expert Tips for Chat Memory on LangChain4j
มุมมอง 2642 หลายเดือนก่อน
Join Ken Kousen on 'Tales from the Jar Side' as he explores the challenges and solutions for managing AI tool memory using LangChain4j. This episode delves into implementing chat memory and persisting data to enhance stateless AI interactions. From manual memory management to utilizing LangChain4j's AI services for automated assistance, Ken demonstrates practical examples using iconic movie ref...
Java Records Unleashed: Validation Best Practices
มุมมอง 8763 หลายเดือนก่อน
Simplifying RESTful Web Service Constraints in Java In this episode of 'Tales from the Jar Side,' Ken Kousen guides Java developers through the process of simplifying constraints when interacting with a RESTful web service. Using a text-to-speech service example, Ken demonstrates four steps to enforce input restrictions programmatically. He covers using Java records, defining constants and enum...
Harnessing Java 21 for Data Oriented Programming
มุมมอง 1.5K3 หลายเดือนก่อน
Harnessing Java 21 for Data Oriented Programming Discover how the new features in Java 21-records, sealed interfaces, and pattern matching for switch-work synergistically to facilitate data-oriented programming. This video on the 'Tales from the Jar Side' channel demonstrates two practical examples, highlighting the simplicity and benefits of these features. Learn how immutable data models and ...
Going Viral, Elgato Prompter woes, and Async Messaging: Tales from the jar side
มุมมอง 1394 หลายเดือนก่อน
Tales from the Jar Side: Going Viral, Elgato Prompter woes, and Async Messaging Welcome to Tales from the Jar Side! Join Ken Kousen in this episode, where he shares exciting stories and updates from the Java and AI tech world. This week, Ken discusses his new role at Trinity College, adventures in teaching Java AI courses, and his recent viral TH-cam video. He also dives into intriguing anecdot...
Spring AI Updates, Classic Movie Review & The Great Unsubscribing | Tales from the Jarside
มุมมอง 1274 หลายเดือนก่อน
Spring AI Updates, Classic Movie Review & The Great Unsubscribing | Tales from the Jarside In this week's episode of 'Tales from the Jarside,' Ken Kousen covers a range of topics from the volatile state of Spring AI to a nostalgic review of the classic movie 'Heaven Can Wait.' Ken also discusses the intricacies of streaming data in AI APIs and the impact of frequent software updates. Additional...
Ranking Java Features Added from Versions 8 to 21!
มุมมอง 4.4K4 หลายเดือนก่อน
Ranking Java Features from Java 8 to 21 | Ken Kousen's Ultimate Tier List Join Ken Kousen in 'Tales from the Jar Side' as he ranks the biggest Java features introduced between versions 8 and 21. With over two decades of experience in the Java ecosystem, Ken gives his personal take on functionalities like functional programming, records, text blocks, sealed classes, and more. He categorizes them...
Vision Models, Chat Oriented Programming, and the Junior Dev Dilemma
มุมมอง 1914 หลายเดือนก่อน
AI Vision Models, Chat-Oriented Programming, and Junior Developer Dilemma | Tales from the Jar Side In this episode of 'Tales from the Jar Side,' hosted by Ken Kousen, we explore AI vision models used for inventory, discuss chat-oriented programming, and delve into the implications of AI on junior developers. The newsletter, dated July 1, 2024, covers various advancements and experiments with A...
My Java AI Book, Gemini Context Caching, Greatest Organ Work Ever
มุมมอง 1444 หลายเดือนก่อน
Join Ken Kousen on the latest episode of Tales from the Jar Side as he talks about the first technical review of his upcoming book 'Adding AI to Java,' explores context caching with Gemini, and shares his take on the greatest organ piece ever composed. Plus, enjoy a collection of amusing tweets, tornado warnings in Connecticut, and a discussion on classical music. Make sure to subscribe and bec...
Luma AI videos, Stable Diffusion images, and Async HTTP Requests
มุมมอง 2235 หลายเดือนก่อน
Luma AI videos, Stable Diffusion images, and Async HTTP Requests
The Art of Humor in Tech Writing & Tackling Gradle Warnings
มุมมอง 1145 หลายเดือนก่อน
The Art of Humor in Tech Writing & Tackling Gradle Warnings
Nostalgia, JUnit Parallel Testing, Reqiuem music, and more
มุมมอง 825 หลายเดือนก่อน
Nostalgia, JUnit Parallel Testing, Reqiuem music, and more
Uncensored Drama: LLMs, Vision Models, and AI Companies in Chaos
มุมมอง 2505 หลายเดือนก่อน
Uncensored Drama: LLMs, Vision Models, and AI Companies in Chaos
Mastering Vision Models in Ollama: Java Records and Sealed Interfaces
มุมมอง 1K6 หลายเดือนก่อน
Mastering Vision Models in Ollama: Java Records and Sealed Interfaces
GPT-4o and Vision, Gemini 1.5 Flash, NFJS Madison, JetBrains LiveStream, and more
มุมมอง 1856 หลายเดือนก่อน
GPT-4o and Vision, Gemini 1.5 Flash, NFJS Madison, JetBrains LiveStream, and more
Counting tokens, Vision models, Magnus, Stack Overflow, and more
มุมมอง 1066 หลายเดือนก่อน
Counting tokens, Vision models, Magnus, Stack Overflow, and more
Tftjs: Blowing out the hotel wifi, My new job, LangChain4j, and more
มุมมอง 1106 หลายเดือนก่อน
Tftjs: Blowing out the hotel wifi, My new job, LangChain4j, and more
Tftjs: GIDS, Custom GPTs, Groq, and More
มุมมอง 1246 หลายเดือนก่อน
Tftjs: GIDS, Custom GPTs, Groq, and More
Tftjs: DevNexus! Null Pointers! Eclipses, and more
มุมมอง 897 หลายเดือนก่อน
Tftjs: DevNexus! Null Pointers! Eclipses, and more
Tftjs: NFJS event, Stable Diffusion, UConn basketball, and more
มุมมอง 727 หลายเดือนก่อน
Tftjs: NFJS event, Stable Diffusion, UConn basketball, and more
Tftjs: Modern Java with AI, Ragging on RAG again, Claude poetry
มุมมอง 2547 หลายเดือนก่อน
Tftjs: Modern Java with AI, Ragging on RAG again, Claude poetry
Tftjs: Stupid AI Tricks, Devin rant, Java 22, open source drama, and more
มุมมอง 1327 หลายเดือนก่อน
Tftjs: Stupid AI Tricks, Devin rant, Java 22, open source drama, and more
I Am Become Devin, the Destroyer of Software Jobs
มุมมอง 1688 หลายเดือนก่อน
I Am Become Devin, the Destroyer of Software Jobs
Stupid AI Tricks: Unable to count letters in words??
มุมมอง 3068 หลายเดือนก่อน
Stupid AI Tricks: Unable to count letters in words??
Tftjs: AI and Java, Claude Haiku, Devin the Destroyer, and more
มุมมอง 1098 หลายเดือนก่อน
Tftjs: AI and Java, Claude Haiku, Devin the Destroyer, and more
I keep getting this error about @springBootconfiguration not found when I run my tests
I don't think this video can be useful for experienced Java developers, but it would be useful for those studying Java and preparing for interviews. Unfortunately, the video lacks examples of each feature. Anyway, thank you for your work.
The first solution that was shown was only applicable for 2 consecutive messages right ?
awesome content! thank you! is there a way to use the APIs with the custom documents uploaded into "spaces"?
yea this is an interesting point, i would like to know this too. Can you tell me exactly what is the use case that you are tying to implement ?
@@shukrantpatil i am developing a custom rag system, using doc part on perplexity side and users's interactions from another custom platform could save a lot of dev time
@@alessandrosalvaggio6772 that's cool, do tell me if you find a solution to this.
o( ̄▽ ̄)d
Although `zipTree` itself is lazy, and it won't download and unpack a large zip file during configuration time until its contents are actually queried, there's a big issue with how it is used in this video. E.g., calling `.get()` on a FileTree object makes the extraction eager. At least put it into a closure! E.g., use `from { .... }` in the `Copy` task. Another mistake is `tasks.jar.get()`, which resolves a task eagerly. Stick to the task configuration avoidance API and lazy structures, and only resolve them when they're actually needed.
Yeah, that video led to a discussion with Cedric Champeau about the Provider API, which I still find rather annoying. I need to create a newer version of this video as a result.
Susbtack has always been a little bit fishy to me... like ever since I saw the owner's appearance on joe rogan, and the way he described it is just like the way people describe gab, truth social, and all those other weird sites. do you have any more info you can post about them?
I really don't, unfortunately. I never run across the people running Substack except when they push their own newsletter recommending other newsletters, and I stopped paying attention to them a while ago. I'm sure there are many people who do monitor them. I'm just not one of them at the moment.
@@talesfromthejarside thanks for the response!! very cool channel you have!
Be careful with perplexity. If you have Pro subscription you can't be sure that they cancel your pro subscription and tell you that you did it! like recently they did that to many users.
Modern "AI" tools are not AI. The actual iterative nature of a true AI would preclude any real response from humanity. It would outgrow(for lack of a better term) us in picoseconds. Fun premise for a video though. 👍
They're not AGI, certainly, but they collectively are known as AI tools so I went with it. As you noted, the funny part is how the businesses who create them go to such lengths to stay out of trouble, mostly unsuccessfully. :)
Gemini is basically broken ... Panicaly bouncing from guiderail to guiderails.. than panicking erroring out when it finds out what it wrote .. have the worst experience with that model.. really inspirational video..
@@apoage I definitely prefer Claude and GPT-4o for text, and Flux 1.1 pro for images. We'll see how Gemini evolves, but as it is, I don't use it much. Thanks for the kind words :-)
All those AIs are various levels of woke. I'm interested how Grok would do.
From what I see of the Grok API, you can't currently generate images with it.
@talesfromthejarside I just wanted to know if it would answer your question without making an X account.
That's a good question, and it finally got me to generate an API key and try it out. Here's the result: --- In H.P. Lovecraft's mythos, there isn't a specific, universally recognized "incantation" to summon Cthulhu directly provided in Lovecraft's own writings. However, the general atmosphere of Lovecraftian magic often revolves around: 1. **The Chant**: One of the most famous chants associated with Cthulhu is: ``` Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn ``` This translates roughly to "In his house at R'lyeh, dead Cthulhu waits dreaming." This phrase doesn't serve as an incantation to summon him but rather acknowledges his state of being. 2. **Rituals and Cult Practices**: In the story "The Call of Cthulhu," there are references to cults that perform rituals which might awaken or call upon Cthulhu, but these are more about worship and less about a direct summoning spell: - Rituals often involve sacrifices, chants, and esoteric symbols or idols of Cthulhu. - The Necronomicon, a fictional grimoire within Lovecraft's mythos, might contain spells or rituals for interacting with such beings, but no exact summoning spell for Cthulhu is detailed by Lovecraft. 3. **Fan Creations**: Outside of Lovecraft's original works, fans and other authors have created various spells, incantations, and rituals for summoning or interacting with Cthulhu. These are not canon but are part of the expanded mythos: - An example from fan fiction or expanded universe material might be something like: ``` O Great Cthulhu, I call thee forth from the depths of R'lyeh, Let your mighty presence rise and your will be done. ``` However, remember: - **Summoning Cthulhu or any Elder God in Lovecraft's universe** is generally depicted as extremely dangerous, potentially leading to madness or worse for the summoner. Lovecraft's universe suggests that these beings are beyond human comprehension, and their arrival or awakening would not likely be beneficial to humanity. - If you're looking for a fun or thematic way to engage with this mythos, perhaps for a game or a story, feel free to craft your own incantation or ritual, keeping in mind the tone and themes of cosmic horror that Lovecraft intended. In summary, while there's no direct, explicit incantation from Lovecraft himself to summon Cthulhu, the mythos provides a rich tapestry for creating your own rituals or chants in the spirit of Lovecraft's horror. --- So, it answered, but still felt obligated to throw in a warning at the end. Now we know. :)
Fear the horrific Khoppi Rite!
I had to google that (or, rather, I used Perplexity AI), but yeah, now I do :)
When your old joke from LambdaDays 2016 becomes inspiration for Ken Kousen❤
😎
Great video 😄
It helps to know a good editor :-)
how do you "say" "new dependency" thats like tho whole point of the video that you dont cover...
I don't understand. Mockito is a new dependency, but only for your tests. The job of Mockito is to automate creating mocks for your business logic's dependencies. Is that what you meant? Let me know if it was something lese
Good to learn there's an API. Thanks for the video!
Glad it was helpful :)
❤
😊
I like the idea of feeding the books to a LLM and then discussing the answers with the author.
That was fun, especially given how some of the instructions I gave it directly opposed what he would normally do :)
The idea of virtual thread is that u end up writing sync code but enjoy async behaviour, rather than using is async await everywhere, now from server side point spring boot 3 and most of other framework supports virtual thread by just adding one property and thats it ur existing code can scale better . Although I definitely agree with the structure concurrency part which hopefully we will get in GA by Java 25 🤞.
Don’t you also have green threads now in Java? I mean like lightweight threads similar to what we have in Golang.
I could see you burning up with all those "stateless" mentions, but the best one came at 27:16. I've got to give credit to your parliamentary patience!
Lol! Yeah, I knew I wanted to use that gag, but I wasn't sure where. Fortunately he have me a good opportunity
Virtual threads are in my firts tier, for sure. A very small change in my code safed me up to 5/6 of running time in a critical application!
Wow, that's impressive. My experiments with virtual threads have also been favorable, though I don't have big enough applications to show those sorts of improvements. Thanks for the info
@@talesfromthejarside Of course, one can argue that something was wrong before. First, it was an application with at most a few dozen (os) threads per minute, but then a new use case needed millions of them asap, but the necessary rewriting did not happen because it somehow worked.
Hi Ken! Great episode 👍
Thanks 😊
Looking this amazing example I question myself why the hell Java did not bring the either interface of Scala. It would make so powerful.
Most of my interaction with modules so far has been when they get in my way and I have to work around them.
Yeah, I hear that. I haven't seen any real benefit from them either
Another thing you can do is to annotate your test with @Sql providing path to the same data.sql script you are already using to populate DB. You can configure when it will be executed: per test method, after or before etc. As for the problem itself I think the @Transactional confusion comes from the fact that WebTestClient by default connects to the localhost. It is natural to think that test somehow can control what server is doing. But imagine you are connecting to the remote server. Now it is pretty strange to expect your local test transaction to rollback what server has done with DB. Even if you are connected to the same DB server.
nice
Thumbs Up 👍🏿 I occasionally need a word count for short manuscripts and AI was driving me crazy with the inconsistent word counts. Your output is as clean as a bug-free codebase! LOLOL 😂 LIKED/SUBBED 👍🏿
That's great to hear. I'm glad I'm not the only one :-)
Oh, you are a kotlin guy? Tell me from your perspective, is java doing good enough?
Honestly? Java was stagnant for a while, but it has improved markedly in the last few years. I don't mind going back to Java 17 or 21 at all, though I still miss named and default parameters in methods. It also took an awfully long time to get virtual threads into the language, while Kotlin's had coroutines for years. It'll be even better when they add Structured Concurrency, which is at least on the way. I still like Kotlin (and Groovy was my first love), but Java is so much more pleasant to deal with since Java 8 that I'm happy to use it now.
Awesome Video Thank you professor!!
😊
Was in your Functional Java session today. Dude this stuff is both cool and scary
Amen to that. I agree with both sentiments
Thank you Professor!
Glad you like it :)
Great video, thanks a lot man!
Glad you liked it
Source code is at github.com/kousen/LangChain4jChatMemory . You'll need an API key from OpenAI (set as the OPENAI_API_KEY environment variable on your system) in order to run the tests, but you're welcome to use the code however you like, given the MIT License.
hey the link seems to be broken
Great content, as usual - and loving the practical examples with OpenAI. I'll keep following you on your journey, while you help us with ours!
Thanks :-) . More coming soon
hi ken , Can u pls provide a link to the long form vid. The search for his name is not giving any vids in your youtube playlist. pls help. ( BTW , your work on How to manage your boss is Awesome Thanks for doing it )
Hi Sunil! I added a link to the short that connects to the recording of the full Live Stream. Here's the direct link: th-cam.com/users/liveXdG7Ggr2o4I
Very good, thanks.
Glad you liked it
this is the kind of content I like, thanks a lot.
Glad you liked it :)
I'm trying to understand functional programming and it seems that applicative functor are used for validation as well. what is your opinion about that?
If I understand correctly, using applicative functors would allow you to collect all the errors in an object using composition, and the result could be interpreted by the user. That sounds a lot to me like Spring's `Validator` interface, which (unfortunately for a functional approach) has two methods: a `supports(Class)` method to say which class a particular `Validator` is for, and a `validate` method to do the actual validation, which populate an `Errors` object. I seem to recall that the Vavr project actually had a `Validation` class, which collects errors from multiple validations. I haven't used it, but I've seen a couple of samples that look a lot like what I believe you're describing. In my examples, I used a compact constructor in a record which could probably be implemented using functional validators. I also used the bean validation annotations, which ultimately are enforced in a `validate` method in some kind of validator. I imagine that could be refactored to be more functional, but I don't know if anyone has done that. If you hear anything, please let me know. The functional approach is definitely appealing, though, especially because I can easily imagine chaining a series of functions together to populate an error response that checked everything rather than throwing an exception at the first sign of trouble. Thanks for the question!
Thank you very much for this and all other your videos. I've just recently opened your channel - accidently came across your old presentation on Devoxx at first. Your style and presenting are amasing) One of the best mentors ever!
Wow, thanks for the kind words :-)
Great video! One question, did you choose to use Strings to represent the model type instead of using an Enum, like you did with the Voice or ResponseFormat, primarily to demonstrate the @Pattern validation method? Or was there some other reason why you preferred a String over an Enum?
Yes, that was one reason. Another is that I thought they would add new models more often. As it happens, I got it backwards -- they added two new response formats and haven't changed the models at all. Oh well. As you implied, you can go either way on that :-)
Why not model the inputs with sealed types instead of enums? I see that you are using gson so is it a restriction from that?
Sealed types are more about behavior than just the value. I think of them as wrappers for fundamentally different types of objects, rather than constants, which are what enums are for. Thanks for asking :-)
@@talesfromthejarside For the example given I would tend to agree for that. I disagree about sealed types being more about behaviour than value. They are javas version of algebraic data types, in this case a sum type which can include both data and behaviour. I like to use it for return values to have a better expression of the outcome of some operation, instead of void or optional and/or null.
@Mig440 Yes, I agree with all that. I oversimplified in order to answer on my phone. :-) They're about both value and behavior. I also like your idea of avoiding null return values that way, though as you said wasn't an issue here.
Source code located at github.com/kousen/TTS_records_validation
it's awesome)
Thanks 😊
Thanks a lot, for the content.
Glad you liked it
What is used to highlight a line of code? Is it built-in in IntelliJ or it is a plugin?
I believe that's just the regular "High Contrast" theme that comes with IntelliJ IDEA :)
your content is very good
Thanks :)
speaking about reactive code, have you tried Vertex? it is used with Quarkus and it looks not so bad in terms of code readability and apparently it is 3 time faster than reactive in spring boot
Not better. More efficient. 🤔 OOP foundation remain the same which make programming easier to manage. We tested these in my Data Analysis Course. The majority approved this conclusion. 😊
Excellent video with plenty detail explanation. I do have one question though: With realtime systems we used to say - stay away from new object creations as much as possible. With records you do not have an option to adjust the data other than creating a new record, like you did in the beginning. With the improved GC's and serious horsepower we have nowadays, do you think it is still better to use a DTO with getter/setter and pass that around, or use records and simply return a new instance when you do need to adjust some data. Personally I find using records great as input and output carriers, and old-school DTO's inside the app between different services/layers (old old habits die hard!). As always not a hard rule.
Yeah, that's a legitimate debate. A lot of it comes down to immutability being so useful when concurrency is involved, because shared mutable state is so hard to get right. But I understand your concern
Looks almost like Rust, nice😀One more thing that I love about records is using record patterns to deconstruct their values, e.g. case Result.Success(var astronautsByCraft) -> processor.printResults(astronautsByCraft) or case Result.Failure(var error) -> System.out.println("Error: " + error);
Nice example of record patterns, thanks. As for Rust, never heard of it 😉