Software Reliability C++ vs Zig

A tiny comparison of C++ and Zig in terms of building reliable software

Erik Engheim
4 min readNov 9, 2020

--

I have spent a lot of my life writing C++ code and if there has been one thing that has bothered me about C++ it is just how fragile it is and generally unhelpful in tracking down bugs.

I don’t have time for an exhaustive check here, so here is just the simplest example I could come up with to make a comparison. We are reading a file which doesn’t exist. In C++ we got:

#include <iostream>
#include <fstream>

--

--

Erik Engheim

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.