designated initializers

Started by Alvaro Herreraover 3 years ago3 messageshackers
Jump to latest
#1Alvaro Herrera
alvherre@2ndquadrant.com

(Coming from /messages/by-id/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.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"El que vive para el futuro es un iluso, y el que vive para el pasado,
un imbécil" (Luis Adler, "Los tripulantes de la noche")

Attachments:

0001-use-designated-initializors.patchtext/x-diff; charset=us-asciiDownload+15-16
#2Andres Freund
andres@anarazel.de
In reply to: Alvaro Herrera (#1)
Re: designated initializers

Hi,

On 2022-08-10 16:03:00 +0200, Alvaro Herrera wrote:

(Coming from /messages/by-id/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

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Andres Freund (#2)
Re: designated initializers

Hello

On 2022-Aug-10, Andres Freund wrote:

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

Right -- pushed, thanks.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/