[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] [PATCH 1/1] server: remove non-reachable call to err()



On Mon, Mar 11, 2013 at 12:28:45AM +0100, Wouter Verhelst wrote:
> On Sun, Mar 10, 2013 at 11:38:10PM +0200, Tuomas Räsänen wrote:
> > 
> > Very well, assert() might be a good idea and I even thought it for a
> > second or two, but then the pedantic side of me took over. Assert-statements
> > do burn my eyes, you know.
> 
> Why?
> 

Just mild allergy, nothing serious.

But seriously speaking, I've just never used to use those. I've always
seen them as unnecessary cruft, as footprints of Captain Obvious or
something. But, I do think that explicit is better than implicit, and
in that light, I think that there might be even some inherent beauty
in them. I'm glad you asked, made me think.

What do you think, should we actually use this kind of assertions more
often throughout the code base? Now there is only a couple of
assertions, but the code is full of hidden/implicit invariants,
waiting to be stated explictly.

-- 
Tuomas



Reply to: