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

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

 



> 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

Ok. I will modify the next patch according to your opinion, I just
hope to understand the problems and make better contributions in the
future.

Thanks.

On Mon, Jan 10, 2022 at 8:49 PM Johannes Schindelin
<Johannes.Schindelin@xxxxxx> wrote:
>
> 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