git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Mar 21, 2014, 21:13 UTC
Message-ID
<532CAB89.7030303@alum.mit.edu>
In-Reply-To
<xmqqr45vv5q8.fsf@gitster.dls.corp.google.com>
On 03/21/2014 06:09 PM, Junio C Hamano wrote:
Show 10 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> 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
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Junio C HamanoNext: Eric Sunshine
Message 12 of 16 in “[GSOC] Selection of the verbose message is replaced with generated message in install_branch_config()”
  1. [GSOC] Selection of the verbose message is replaced with generated message in install_branch_config()Aleksey Mokhovikov, Mar 17, 2014
  2. Matthieu MoyMar 17, 2014
  3. Aleksey MokhovikovMar 18, 2014
  4. Eric SunshineMar 17, 2014
  5. Aleksey MokhovikovMar 18, 2014
  6. Aleksey MokhovikovMar 18, 2014
  7. Aleksey MokhovikovMar 18, 2014
  8. Eric SunshineMar 19, 2014
  9. Aleksey MokhovikovMar 20, 2014
  10. Eric SunshineMar 21, 2014
  11. Junio C HamanoMar 21, 2014
  12. Michael HaggertyMar 21, 2014
  13. Eric SunshineMar 21, 2014
  14. Michael HaggertyMar 21, 2014
  15. Aleksey MokhovikovMar 24, 2014
  16. Michael HaggertyMar 24, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.