No video

Functional Error Handling in Kotlin, Nullables and Options

  Рет қаралды 3,135

Rock the JVM

Rock the JVM

Жыл бұрын

blog post: blog.rockthejvm.com/functiona...
Complete Kotlin course: rockthejvm.com/p/kotlin-essen...
This video is a guide to functional programming in Kotlin. We'll first see how the traditional way of dealing with errors in Kotlin is not "functional" from the point of view of referential transparency, with a focus on absent values.
Then we'll explore a few tools in Kotlin and Arrow that will help us deal with the possible absence of values (and subsequent errors this causes) in a functional way using nullables, scoped functions, options and more.
The next video will show you how you can also manage the cause of the errors you see in applications, in a functional way.
Follow Rock the JVM on:
LinkedIn: / rockthejvm
Twitter: / rockthejvm
Blog: Blog: blog.rockthejvm.com
-------------------------------------------------------------------------
Home: rockthejvm.com
-------------------------------------------------------------------------

Пікірлер: 11
@dmytrooleinichenko9865
@dmytrooleinichenko9865 Жыл бұрын
Great video! Would be cool to see your video about Arrow effects
@CffYT
@CffYT 8 ай бұрын
Minor bug in your video and the article is the use of maxBy when finding the highest salary. Because your DB has values in it it won't be a problem but in the case of an empty DB it would throw an exception. maxByOrNull would prevent that. No biggie but given it's a demo about exception handling thought I'd raise it :)
@rockthejvm
@rockthejvm 8 ай бұрын
Received!
@leorandomnickname
@leorandomnickname Жыл бұрын
I think that in the example JobsService2 since you moved the findJobs call to the try block , so you are comparing two different programs, so you cannot say that is a valid example of referencial transparency violation. If you keep the line in the same position, and replace the findJobs call with the throw statement, the behavior is the same in both cases. But I get the point.
@alekseiandrosov1099
@alekseiandrosov1099 Жыл бұрын
Rip scala
@rockthejvm
@rockthejvm Жыл бұрын
no
@dmytrooleinichenko9865
@dmytrooleinichenko9865 Жыл бұрын
Kotlin is awesome, but Scala has a lot more features
@terrormapu
@terrormapu Жыл бұрын
While Kotlin is no Scala..it does push Scala into a even more niche language
@levinie5081
@levinie5081 Жыл бұрын
I write kotlin for work every day, but the more I consider my code, the more I am thirsty for Scala 3. Kotlin's type system and ability of abstraction is way weaker than Scala 3.
@qbyteconsulting5729
@qbyteconsulting5729 Жыл бұрын
Kotlin + Arrow does a great job - so maybe RIP Java. However, Scalas pattern matching is powerful and its syntactic cleanness make it ideal for DSLs (things you just can't do in Kotlin) and then there is the wonderful for comprehension. Arrow is a little minimalist, or at least when I used it, so it doesn't quite compare to CATS or ZIO for example.
Functional Error Handling In Kotlin: Either and Result
55:11
Rock the JVM
Рет қаралды 4,8 М.
The Power of Recursion - How To Think Code Clearly
19:34
Rock the JVM
Рет қаралды 2,5 М.
CHOCKY MILK.. 🤣 #shorts
00:20
Savage Vlogs
Рет қаралды 26 МЛН
Doing This Instead Of Studying.. 😳
00:12
Jojo Sim
Рет қаралды 29 МЛН
Kotlin Type Classes - a Practical Pattern to Organize Your Code
31:59
Functional Error Handling in Kotlin, Part 3 - the Raise DSL
38:50
Microservices and gRPC in Scala with FS2 and Scalapb
27:45
Rock the JVM
Рет қаралды 3,3 М.
A Load Balancer in Scala with Cats Effect and Http4s
37:33
Rock the JVM
Рет қаралды 4,1 М.
CHOCKY MILK.. 🤣 #shorts
00:20
Savage Vlogs
Рет қаралды 26 МЛН