Re: [PATCH v9 9/9] cocci: allow padding with `strbuf_addf()`
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 10, 2022, 12:49 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2201101346090.339@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20220110082254.54400-1-dyroneteng@gmail.com>
Hi Teng,
On Mon, 10 Jan 2022, Teng Long wrote:
Show 5 quoted lines
> [...] about the using "strbuf_addf(line, "%7s" , "-");" or > "strbuf_addstr(line, " -");". [...] > > Why I prefer more of the former that is because, for the single line, > it's more readable I think.
I strongly disagree. Using a format requires the reader to interpret a `printf()` format, to remember (if they ever knew) the rules about padding with `%<number>s` formats, and then to satisfy themselves that the result is correct.
That's quite the cognitive load you put on the reader for something as trivial as " -".
Not a fan, Johannes