Share via


Future examples - standards, conventions

I'm going to start blogging some more and I just wanted to be explicit, as Raymond is, about the coding style I am going to use for my purposes.

I have several types of issues I want to use my soapbox to discuss and elicit feedback.

I'm going to start a hopefully long series discussing error handling.  In this series, I will be using plain "C" and a convention around returning an int, where 0 means success and nonzero means failure.  I considered using bool from C++ but then when I want to make a point about dealing with specific conditions I'm either going to have to rely on an out-of-band mechanism like errno/GetLastError() or vary the convention.

I don't plan to discuss language nuances in this series.  I will use C as a high-level assembly language and attempt to explore the semantics and requirements of reliable code in the case of failures in underlying layers.  My results should be uniform across all languages and metaphors with the execption of purely functional problem/solution spaces where there is no mutation of state but instead only generation of garbage and new state.  Whether FP is the unrealized savior of the programming world or not is not a topic I particularly want to touch on at this point.

Anyways this was a boring post but I just wanted to say it so that when I avoid things like exceptions and objects with constructors and destructors, I want it to be as clear as possible that those things are syntactic sugar.  They sure do taste good; I want to identify and discuss concrete universal problems in reliable software, not necessarily wallow in the greatness or pure evil of some clever syntactic construct or other.