bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] Re: extend the scope of xasprintf


From: Paul Eggert
Subject: Re: [bug-gnulib] Re: extend the scope of xasprintf
Date: Wed, 10 May 2006 13:26:28 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

>      The less you have to think when manipulating some code, the better.

True, but there are other concerns.  When I read C code like this:

      (char *) <expression>

I stop mentally and ask "why is that cast there?"  Casts like that are
dangerous, and I need to check them by hand, since the compiler won't
help me.  So I prefer to avoid casts when that is easy, as is the case
here.  This improves the quality of the compile-time checking and
makes the code shorter and easier to read.

I guess it partly depends on whether one prefers code to be easy to
read, or easy to write.  I usually prefer the former.

The C++ issue is another story.  I used to worry about porting to C++,
but I find that less and less of an issue, partly because there is so
much code that simply won't work with C++ (e.g., code derived from
glibc).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]