u/Infamous_Sorbet4021in r/Kotlin • Recommends
From Exceptions to Rich Errors: Rethinking Error Handling in Kotlin I Michail Zarečenskij
#richerrors#errorhandling#exceptions
2K subscribers • 1 video on Hallway
Advanced. Deep dive for people who know the field.
665 views10 months ago1 recommendation
Programming languagesSoftware designKotlinLanguage design and type systemsDesign patterns
Michail Zarečenskij explores Kotlin's ongoing design work on Rich Errors, treating errors as values integrated directly into the type system.
In this talk, we’ll explore how Java’s exception model works, how Kotlin has adapted and evolved it, and which other “organic” approaches, such as using Result, Optional, two return values, or sealed hierarchies, have gained traction for signaling errors in recent years. We’ll also look at other programming ecosystems to see what we can learn from their successes and trade-offs. We'll also look at how error handling is approached in different domains, such as Spring and Android. From there, we’ll dive into Kotlin’s ongoing exploration of a new error model: Rich Errors. The core idea is to treat errors as values. Similar to Kotlin’s nullability system, where null is a special value, Rich Errors extend the model to allow declaring “error values” that are integrated into the type system. We’ll discuss the design principles, potential benefits, and how leverage Kotlin's flow typing to work with errors.What people say. Recommended for its insights into the future of error handling and the proposed Rich Errors model in Kotlin.
u/Infamous_Sorbet4021in r/Kotlin • Recommends