Zeuthen: Writing a C Library, Part 3

48

The third part of David Zeuthen’s guide to writing low-level libraries looks at modularity, error handling, and object-oriented design. “Even with a library doing proper parameter validation (to catch programmer errors early on), if you pass garbage to a function you usually end up with undefined behavior and undefined behavior can mean anything including formatting your hard disk or evaporating all booze in a five-mile radius (oh noz). That’s why some libraries simply calls abort() instead of carrying on pretending nothing happened.

Read more at LWN