Why should I have written ZeroMQ in C, not C++ (2012)
It seems all too often we (coders) are encouraged to think of errors as these <i>exception</i>al things that happen rarely; deserving only of a few cursory preventative treatments to the code -- or worse, treated as something only to be fixed lazily, as bugs and crashes surface during testing. Indeed -- this philosophy is ingrained into a significant percentage (if not the majority) of the programming languages we use!<p>On the contrary, I believe we should <i>expect to spend the majority of software engineering time writing and thinking through error-handling code, before even your first test[1].</i><p>I&#x27;d even go so far as to say: If you&#x27;re not spending at least half your time on so-called &#x27;error handling&#x27;, you&#x27;re probably doing something wrong, like using a language feature (like exceptions) to defer that technical debt to later -- and you&#x27;ll regret it, if your project matures, I assure you.<p>This is why I so greatly appreciate languages like Rust and Zig[2] which remove exceptions and unchecked null pointers from the language entirely (with few edge-case exceptions), and provide a powerful and robust type system that allows us to express and handle error conditions naturally, safely, and elegantly.<p>[1] To be clear, by no means am I downplaying the importance of test code, or even manual testing; rather, I&#x27;m arguing that purely &quot;test driven development&quot; is <i>not sufficient</i> to yield extremely robust software of significant sophistication.<p>[2] These aren&#x27;t the only examples, but they&#x27;re among the only that aim to be C++ (Rust) and C (Zig) replacements, that also made the &quot;right&quot; design choices (IMO) in removing both exceptions and unchecked null references.