You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There has been various changes in naming for methods over the lifetime of the development of temporal_rs, specifically around the use of snake case in methods and file names. The intended goal of this issue is to come to a consensus moving forward for naming conventions in temporal_rs.
So the first question to answer should probably be:
Should snake case be adhered to 100% of the time regardless of method length?
Should this naming convention also then be extended to filenames and modules?
Should "Plain" be preserved in method names: "to_date" vs. to_plain_date or "to_time" vs. "to_plain_time"
General thoughts
My general thought on this subject is that naming in general is a question of to what degree snake case should be preserved in the general API. For instance, ZonedDateTime as a type is fine for a struct name, but can create some rather long and unyielding method names that may not make the best API if expanded to full snake case, e.g. to_zoned_date_time. In order to avoid long snake case methods that may make methods hard to deal with, ZonedDateTime has been condensed into one "proper" noun of sorts, e.g. to_zoneddatetime.
The issue with doing this type of naming is how it extends to other methods:
to_zoned_date_time vs. to_zoneddatetime
to_plain_date_time vs to_plaindatetime
to_plain_time vs to_plaintime
There are a few general names that have gone through various names and are in scope in connection to this issue (see below).
There has been various changes in naming for methods over the lifetime of the development of
temporal_rs
, specifically around the use of snake case in methods and file names. The intended goal of this issue is to come to a consensus moving forward for naming conventions intemporal_rs
.So the first question to answer should probably be:
to_plain_date
or "to_time" vs. "to_plain_time"General thoughts
My general thought on this subject is that naming in general is a question of to what degree snake case should be preserved in the general API. For instance,
ZonedDateTime
as a type is fine for a struct name, but can create some rather long and unyielding method names that may not make the best API if expanded to full snake case, e.g.to_zoned_date_time
. In order to avoid long snake case methods that may make methods hard to deal with,ZonedDateTime
has been condensed into one "proper" noun of sorts, e.g.to_zoneddatetime
.The issue with doing this type of naming is how it extends to other methods:
to_zoned_date_time
vs.to_zoneddatetime
to_plain_date_time
vsto_plaindatetime
to_plain_time
vsto_plaintime
There are a few general names that have gone through various names and are in scope in connection to this issue (see below).
Time Zone
tz
,timezone
, ortime_zone
Time zone has changed in various points.
PlainDateTime / DateTime
datetime
,plaindatetime
,date_time
,plain_date_time
ZonedDateTime
zoneddatetime
,zoned_date_time
General thoughts?
Also, if anyone has any other thoughts regarding to this issue that I may have missed feel free to let me know
The text was updated successfully, but these errors were encountered: