Re: BitmapHeapScan streaming read user and prelim refactoring - Mailing list pgsql-hackers

From Robert Haas
Subject Re: BitmapHeapScan streaming read user and prelim refactoring
Date
Msg-id CA+TgmoYu8GZeiYfSm6AmeZ83B-=BopezfbomwL1A-owk26SY4w@mail.gmail.com
Whole thread Raw
In response to Re: BitmapHeapScan streaming read user and prelim refactoring  (Melanie Plageman <melanieplageman@gmail.com>)
Responses Re: BitmapHeapScan streaming read user and prelim refactoring
List pgsql-hackers
On Wed, Jun 19, 2024 at 2:21 PM Melanie Plageman
<melanieplageman@gmail.com> wrote:
> If we want to make it possible to use no tools and only manually grep
> for struct members, that means we can never reuse struct member names.
> Across a project of our size, that seems like a very serious
> restriction. Adding prefixes in struct members makes it harder to read
> code -- both because it makes the names longer and because people are
> more prone to abbreviate the meaningful parts of the struct member
> name to make the whole name shorter.

I don't think we should go so far as to never reuse a structure member
name. But I also do use 'git grep' a lot to find stuff, and I don't
appreciate it when somebody names a key piece of machinery 'x' or 'n'
or something, especially when references to that thing could
reasonably occur almost anywhere in the source code. So if somebody is
creating a struct whose names are fairly generic and reasonably short,
I like the idea of using a prefix for those names. If the structure
members are things like that_thing_i_stored_behind_the_fridge (which
is long) or cytokine (which is non-generic) then they're greppable
anyway and it doesn't really matter. But surely changing something
like rs_flags to just flags is just making everyone's life harder:

[robert.haas pgsql]$ git grep rs_flags | wc -l
      38
[robert.haas pgsql]$ git grep flags | wc -l
    6348

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Removing log_cnt from pg_sequence_read_tuple()
Next
From: Jim Jones
Date:
Subject: Re: [PATCH] Add CANONICAL option to xmlserialize