Subject: Re: [PATCH v4 02/13] column: add API to print items in columns

From: Junio C Hamano <[email-masked]>
Date: Fri, 03 Feb 2012 14:55:32 -0800

Nguyễn Thái Ngọc Duy  <[email-masked]> writes:

> +struct string_list_item *add_cell_to_list(struct string_list *list,
> +					  int mode,
> +					  const char *string)
> +{
> +	if (mode & COL_ENABLED)
> +		return string_list_append(list, string);
> +	return NULL;
> +}
> +
> +void print_cell(struct string_list *list, int mode, const char *string)
> +{
> +	if (!add_cell_to_list(list, mode, string))
> +		printf("%s\n", string);
> +}

I find these two functions showing an extremely bad taste in the code
design. "If we for some reason fail to add the string to the list, we
fallback to print it straight away" is the natural reading of this code,
but that is absolutly not the impression the author of this piece of
crap^Wcode wanted to give to its readers.

Am I being too ascestically perfectionist?