-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Blog/add typed error handling in kotlin article (#172)
# In this PR - add typed error handling article to community blog <img width="1904" alt="image" src="https://user-images.githubusercontent.com/15880686/232479984-eebb2383-0084-4df6-b1c7-0872599839dd.png">
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Typed Error Handling in Kotlin | ||
image: https://miro.medium.com/v2/resize:fit:4800/0*kOFUN-7oR7gyGXu_ | ||
category: articles | ||
tags: [core, articles] | ||
link: https://medium.com/@mitchellyuwono/typed-error-handling-in-kotlin-11ff25882880 | ||
--- | ||
|
||
# Typed Error Handling in Kotlin | ||
|
||
A comparative study about several typed-error handling practices in Kotlin. | ||
|
||
There are various approaches to error handling in the Kotlin community. | ||
In this article we’ve explored a small subset of typed error handling practices in the community. | ||
|
||
From the approaches explored, there were three patterns that aligns with Kotlin recommendation with | ||
relatively low cognitive complexity including: Sealed class matching with early returns, Arrow's `either { }` builder, | ||
and Arrow's `context(Raise<E>)` with context-receivers. | ||
|
||
Arrow's `context(Raise<E>)` achieved the most optimized score on all aspects of | ||
developer productivity. This includes having the lowest cognitive complexity, the lowest cyclomatic complexity | ||
as well as the most succinct with the least lines of codes. | ||
|
||
Read the full article: [Typed Error Handling in Koltin](https://medium.com/@mitchellyuwono/typed-error-handling-in-kotlin-11ff25882880). |