On Wed, May 06, 2026 at 11:15:19PM +0200, Alejandro Colomar via Mutt-dev wrote: > To be honest, I find the code below completely unreadable.
That's a fair criticism, I didn't spend enough (any, really) time trying to simplify the logic. Simplification was definitely possible. The second version is much clearer, I think. FWIW, I found yours no more readable, mostly because the logic was spread across too many layers. On Thu, May 07, 2026 at 05:44:56PM +0200, Alejandro Colomar via Mutt-dev wrote: > On 2026-05-07T11:21:35-0400, Derek Martin wrote: > > > Allman curly brace style, being free to omit the braces for > > > single lines if you like. > > > > Due to past experience, I don't do this unless the conditional statement > > fits > > comfortably on the same line as the conditional. It tends to lead to > > bugs where someone expands what is done conditionally (or tries), but > > they forget to add the braces, leading to a hard-to-see logic error. > > This is not a real problem, and has not been a real problem for many > years (if not decades). -Wmisleading-indentation exists since GCC 6 > (released in 2015), and is part of -Wall, and it precludes the > possibility of such logic errors. No it doesn't, because not everyone is compiling on modern systems, not everyone compiles with -Wall, and though mutt does, it doesn't compile with -Werror, and not everyone reads (or always notices) warnings. Readability is somewhat subjective; there are style choices that Mutt carries which I personally don't like and find less readable. I have no objection to Kevin removing the extra braces if he chooses; I will always write code with them. -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 -=-=-=-=- This message is posted from an invalid address. Replying to it will result in undeliverable mail due to spam prevention. Sorry for the inconvenience.
