From: Sam Ravnborg Date: Fri, 05 Oct 2007 17:24:25 GMT Subject: Re: [AGGREGATED PATCH] Fix in-place editing functions in convert.c Message-ID: <20071005172425.GD31413@uranus.ravnborg.org> In-Reply-To: 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