Re: JSON Function Bike Shedding - Mailing list pgsql-hackers

From Robert Haas
Subject Re: JSON Function Bike Shedding
Date
Msg-id CA+TgmoaVY=37tVorUUD5KO2_DecRKsBRt8iPBbMyXevU2RA=GQ@mail.gmail.com
Whole thread Raw
In response to JSON Function Bike Shedding  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: JSON Function Bike Shedding  ("David E. Wheeler" <david@justatheory.com>)
Re: JSON Function Bike Shedding  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
On Tue, Feb 12, 2013 at 2:18 PM, David E. Wheeler <david@justatheory.com> wrote:
> Hello Hackers,
>
> If you dislike bike-shedding (and who does?), delete this email and the ensuing thread right now. You have been
warned!
>
> I have been playing with Andrew’s JSON enhancements and really enjoying them. I am already using them in code I’m
developingfor production deployment in a month or two. Kudos! 
>
> However, I am not so keen on the function names. They all start with json_! This mostly feels redundant to me, since
thetypes of the parameters are part of the function signature. 
>
> Therefore, I would like to propose different names:
>
> Existing Name                  Proposed Name
> --------------------------     ----------------------------------------
> json_array_length()             array_length() or length() or size()
> json_each()                     each_json()
> json_each_as_text()             each_text()
> json_get()                      get_json()
> json_get_as_text()              get_text()
> json_get_path()                 get_json()
> json_get_path_as_text()         get_text()
> json_object_keys()              get_keys()
> json_populate_record()          record() or row()
> json_populate_recordset()       records() or rows()
> json_unnest()                   get_values()
> json_agg()                      collect_json()
>
> Note that I have given json_get() and json_get_path() the same names, as it seems to me that the former is the same
asthe latter, with only one parameter. Same for json_get_as_text() and json_get_path_as_text(). 

I realize I'm in the minority here, but -1 from me on all of this.
Should we also rename xml_is_well_formed() to just is_well_formed()?
string_agg() to agg()?  Eventually we will have more data types, and
some of them will have functions that could also be called rows() or
get_values(), but it's unlikely that they'll have exactly the same
behavior, which will start to make things confusing.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Unarchived WALs deleted after crash
Next
From: Simon Riggs
Date:
Subject: Re: Unarchived WALs deleted after crash