<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Error Handling on Mi&amp;Bee Blog</title><link>/en/tags/error-handling/</link><description>Recent content in Error Handling on Mi&amp;Bee Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>蓝宝石的傻话</managingEditor><lastBuildDate>Tue, 23 Jun 2026 10:45:00 +0800</lastBuildDate><atom:link href="/en/tags/error-handling/rss.xml" rel="self" type="application/rss+xml"/><item><title>Error Handling: A Third Way Beyond Go and Rust</title><link>/en/posts/programming/zig-error-handling/</link><pubDate>Tue, 23 Jun 2026 10:45:00 +0800</pubDate><guid>/en/posts/programming/zig-error-handling/</guid><description>&lt;p&gt;This article is based on Zig 0.16.&lt;/p&gt;
&lt;h2 id="three-error-handling-paradigms"&gt;Three Error Handling Paradigms&lt;/h2&gt;
&lt;p&gt;Error handling is one of the most debated topics in programming language design. Go&amp;rsquo;s multiple return values, Rust&amp;rsquo;s &lt;code&gt;Result&amp;lt;T, E&amp;gt;&lt;/code&gt; enum, and Zig&amp;rsquo;s error union type represent three fundamentally different philosophies. This article assumes you have Go or Rust experience and uses that as a reference frame to understand Zig&amp;rsquo;s design.&lt;/p&gt;
&lt;h3 id="go-multi-return--if-err--nil"&gt;Go: Multi-return + if err != nil&lt;/h3&gt;
&lt;p&gt;Go&amp;rsquo;s philosophy is &amp;ldquo;explicit over implicit&amp;rdquo; — functions can return multiple values, and the convention is that the last return value is &lt;code&gt;error&lt;/code&gt;. Every call site must handle it:&lt;/p&gt;</description></item></channel></rss>