On Thu, May 21, 2026 at 01:39:32PM +0200, Alejandro Colomar wrote:
> Hi Rene,
> 
> On 2026-05-21T13:22:19+0200, Rene Kita wrote:
> > On Thu, May 21, 2026 at 06:20:04PM +0800, Kevin J. McCarthy wrote:
> > > On Thu, May 21, 2026 at 11:24:38AM +0200, Alejandro Colomar via Mutt-dev 
> > > wrote:
[...]
> > > > I would very much rewrite the above in two lines.  I don't see a good
> > > > reason to embed the assignment in the conditional (and that often leads
> > > > to bugs due to accidents).  I suggest:
> > > > 
> > > >         fmtlen = mutt_strlen(fmt);
> > > >         if (fmtlen > 0 && fmt[fmtlen - 1] == '\n')
> > > 
> > > Sure I'll make this change.  Again, in my defense, this is verbatim
> > > pulled from match_body_patterns().  So although it's compact, I knew it
> > > was working.
> > 
> > I'd prefer the compact version, but that is just me.
[...]
> > I just wanted to
> > speak up to say that such discussions are not helpful, IMHO.
> 
> I'd like to friendly disagree.  Carefully written code tends to be
> safer.

I won't comment on the above as I think that discussions about
terse code vs the non-terse code are not helpful. I just wanted to raise
my voice to put it on the record that there are still people who prefer
terse C code.

This does not mean, that I don't care about carefully written code.

> For example, the cast I reported is fully redundant, but it doesn't do
> anything wrong.

To be clear, my comment was not about the cast, casts can be dangerous
and removing an unnecessary cast is the right thing. How one writes
their if-statements is a matter taste and thus always arguable.

Now I already said more than I wanted. :-)

Reply via email to