Re: designated initializers - Mailing list pgsql-hackers

From Andres Freund
Subject Re: designated initializers
Date
Msg-id 20220810165629.nz22lifj4as3g7ut@awork3.anarazel.de
Whole thread Raw
In response to designated initializers  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: designated initializers
List pgsql-hackers
Hi,

On 2022-08-10 16:03:00 +0200, Alvaro Herrera wrote:
> (Coming from https://postgr.es/m/20220809193616.5uucf33piwdxn452@alvherre.pgsql )
> 
> On 2022-Aug-09, Alvaro Herrera wrote:
> 
> > On 2022-Aug-09, Andres Freund wrote:
> > 
> > > Mildly wondering whether we ought to use designated initializers instead,
> > > given we're whacking it around already. Too easy to get the order wrong when
> > > adding new members, and we might want to have optional callbacks too.
> > 
> > Strong +1.  It makes code much easier to navigate (see XmlTableRoutine
> > and compare with heapam_methods, for example).
> 
> For example, I propose the attached.

+1 I've fought with this one when fixing a conflict when rebasing a patch...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: moving basebackup code to its own directory
Next
From: Alvaro Herrera
Date:
Subject: Re: moving basebackup code to its own directory