Karl Fogel wrote:
>
> Jim Blandy <jimb@savonarola.red-bean.com> writes:
> > I think I'd actually prefer not to use any macro at all. I think
> >
> > if (error) return svn_quick_wrap_error (error);
> >
> > is pretty clear.
>
> In such cases, I actually do prefer a macro, here's why:
>
> The above is clear code, but you have to read it. It does not have
> any distinctive visual pattern that says to the programmer "What's
> going on here is the usual thing, which you have seen scores of times
> before, so move along."
>
> The formatting you give above is not how it would always appear.
> Depending on the indentation level, a newline might have to be added
> somewhere; depending on the context, braces might be needed. So it
> can't always be recognized quickly.
>
> But if it were an all-caps macro, then whenever you *did* see a
> written-out conditional, you'd know it to be a conditional you should
> probably care about, one having something to do with the logic of the
> code.
+1 on the macro--good explanation.
--
Daniel Rall <dlr@finemaltcoding.com>
Received on Sat Oct 21 14:36:05 2006