Subject: Re: [AGGREGATED PATCH] Fix in-place editing functions in convert.c

From: Sam Ravnborg <[email-masked]>
Date: Fri, 5 Oct 2007 19:24:25 +0200

Hi Linus.

> No, following patch is fundamentally broken - it's not even a good 
> starting point. It's bad, bad, bad.
> 
> It's also broken in another way: we want it to be really easy to use 
> strbuf's as normal C strings.
> 
> Yes, many (totally idiotic and broken) interfaces think it's so important 
> to "protect" their internal data structures that you have a 
> "string_to_c()" helper function for that. That may be "good abstraction", 
> but it's totally idiotic, because it results in horrible source code!
> 
> Tell me which is more readable:
> 
> 	printf("Hello %s\n", sb->buf);
> 
> or
> 
> 	printf("Hello %s\n", strbuf_to_c(sb));

Point taken although no sane person would name it strbuf_to_c(...).

	Sam