Re: [PATCH v9 9/9] cocci: allow padding with `strbuf_addf()`

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

 



Hi Teng,

On Mon, 10 Jan 2022, Teng Long wrote:

> [...] 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux