Subject: Re: [PATCH][GSOC] Selection of the verbose message is replaced with generated message in install_branch_config()

From: Michael Haggerty <[email-masked]>
Date: Fri, 21 Mar 2014 22:13:45 +0100

On 03/21/2014 06:09 PM, Junio C Hamano wrote:
> Eric Sunshine <[email-masked]> writes:
> 
>> Sorry, you're right about message[0] case not being a crasher (though
>> the assert() still seems overkill).
> 
> Assert() often becomes no-op in production build.  I think this may
> be an indication that "table-driven" may not be as good an approach
> as many candidates thought.  The microproject suggestion asks them
> to think _if_ that makes sense, and it is perfectly fine for them if
> they answer "no, it introduces more problems than it solves".

My expectation when I invented that microproject was that converting the
code to be table-driven would be judged *not* to be an improvement.  I
was hoping that a student would say "the 'if' statement is OK, but let's
delete this ridiculous unreachable else branch".  Possibly they would
convert the "if" chain into nested "if"s, which I think would allow some
code consolidation in one of the branches.

But not a single student agreed with me, so I must be in a minority of
one (which, unfortunately, is the definition of lunacy).

The multidimensional array lookup table is not so terrible, but I
personally still prefer the "if".

Michael

-- 
Michael Haggerty
[email-masked]
http://softwareswirl.blogspot.com/