Re: boolin comment not moved when code was refactored

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: boolin comment not moved when code was refactored
Date: 2023-10-19 04:17:33
Message-ID: CAHut+PvGFnPWx7AA7gTpKtX6QsXOOOiPME59zMNcH8JHun+tGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 19, 2023 at 2:55 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> > On Thu, Oct 19, 2023 at 10:35 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >> I happened upon a function comment referring to non-existent code
> >> (that code was moved to another location many years ago).
> >>
> >> Probably better to move that comment too. Thoughts?
>
> > Agreed. +1 to move that comment.
>
> Hm, I'm inclined to think that the comment lines just above:
>
> * boolin - converts "t" or "f" to 1 or 0
> *
> * Check explicitly for "true/false" and TRUE/FALSE, 1/0, YES/NO, ON/OFF.
> * Reject other values.
>
> are also well past their sell-by date. The one-line summary
> "converts "t" or "f" to 1 or 0" is not remotely accurate anymore.
> Perhaps we should just drop it? Or else reword to something
> vaguer, like "input function for boolean". The "Check explicitly"
> para no longer describes logic in this function. We could move
> it to parse_bool_with_len, but that seems to have a suitable
> comment already.
>

Yes, I had the same thought about the rest of the comment being
outdated but just wanted to test the water to see if a small change
was accepted before I did too much.

> In short, maybe the whole comment should just be
>
> /*
> * boolin - input function for type boolean
> */
>

How about "boolin - converts a boolean string value to 1 or 0"

======
Kind Regards,
Peter Smith.
Fujitsu Australia.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2023-10-19 04:26:54 Re: boolin comment not moved when code was refactored
Previous Message Andrei Lepikhov 2023-10-19 04:04:52 Re: Asymmetric partition-wise JOIN