Re: [Hampshire] Code style

Top Page

Reply to this message
Author: Keith Edmunds
Date:  
To: hampshire
Subject: Re: [Hampshire] Code style
To me, Style A is much clearer and more logical. Style B is favoured by
those who prefer obfuscated code. Just my opinion, of course...

Perhaps more importantly, there is presumably a reason why, in some cases,
the fast path result cannot be used. Therefore the first line in Style B
will result in an error/exception/whatever, depending on the language, or
if it doesn't, the variable 'result' will contain junk until such time as
the slow path has been completed. In fact, in light of that argument, I'd
struggle to find any justification for using Style B over Style A.

Keith