Lobsters
Read post

ok Considered Harmful

The post discusses the convention of naming boolean existence variables in Go as 'ok', and argues that it is harmful and should be replaced with a more descriptive convention such as 'exists'. It provides examples and benefits of using the new convention.

    #golang
May 15, 2024•10m read time•From dolthub.com
Post cover image
Table of contents
Introductionokok: Not for just mapsok Considered HarmfulA better alternative existsVariation: optional channel receivesBut I like using okAn exception: type assertionsDoesn't this apply to err as well?Conclusion
562 Impressions1 Comment
Lobsters's image
Lobsters

Lobsters is a community-driven platform for sharing and discussing links to articles, tutorials, and...

1.9K Followers

•

36.1K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard