Wow, that is a massive improvement to Kotlin. I love Kotlin already but this takes the cake. I can’t stand Go and its syntax, on the other hand.
Kotlin and Go couldn't be approaching their error handling pains more differently.
Go: https://go.dev/blog/error-syntax
TL;DR: While Kotlin is getting rich errors, Go is getting... nothing. And please stop asking for it, the community clearly won't come to a consensus.
Like it or not, `if err != nil` is here to stay. Don't get me wrong, I really like Go and have even been defaulting to it for a lot of my own projects. But when you work with Kotlin on a daily basis, Go codebases start to feel like C with a few extra goodies and polished corners.
#GoLang #Kotlin #ErrorHandling #LanguageDesign #ProgrammingLanguages #DevThoughts
Discussion
Kotlin is getting awesome, for sure. Really looking forward to it. I gotta admit I like Go too. Not a fan of the Go community zealotism, but the language has its place. Like, for Nostr relay stuff, I'd pick Go over JavaScript/TypeScript and even Rust. Mostly because nostr:nprofile1qqsrhuxx8l9ex335q7he0f09aej04zpazpl0ne2cgukyawd24mayt8gprfmhxue69uhhq7tjv9kkjepwve5kzar2v9nzucm0d5hszxmhwden5te0wfjkccte9emk2um5v4exucn5vvhxxmmd9us2xuyp is carrying all of us with his libs, tools, etc 🤣
But yeah, beyond “Fiatjaf knows what he's doing” thing, Go is actually pretty solid for sending JSON and other stuff over WebSockets. Not sure I'd use it for my usual daily-job enterprisy stuff with infinitely complex domains though. Not that you can’t, it is just that go would not be my my go-to.