-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What should be the long-term name of LocalDateTime
?
#707
Comments
Copying from #700:
That said, a concern I have with When it comes time to pick the final name, I think it'd be helpful to consider both this type and the Ironically, I have a stronger opinion about the name of For |
I've followed this proposal from the start, but had to focus on other things for the past couple of months. I'm finally catching back up and was very surprised to see the Naming is important, and definitely hard, as all the previous bikeshedding issues and PRs about names have shown. The prior discussions most relevant to this particular issue are:
A particularly noteworthy comment is at #11 (comment):
Personally, I don't see what's wrong with the name
There are several points to make about this:
As a side note... I always liked the concept of a zoned date-time object (the previous |
@gilmoreorless welcome back. I fully agree with you. I think the name is definitely a placeholder only 😄 |
Yep, the current name is just a placeholder. My suggestion is to defer the naming question for a few weeks while we define exactly how this new type will behave and how it will relate to other Temporal types. Also IMHO it will be helpful for folks to have a little time to play around with LocalDateTime sample code to get a real-world sense of how the type will be used. Depending on the above, some names may be more or less appropriate. Also, I suspect that it will be a lot easier to get consensus on naming once we have consensus on scope/behavior/etc. This is a nice way of suggesting that we don't cover the type-naming question in tomorrow's marathon meeting. ;-) |
I'm fine with LocalDateTime → DateTime and DateTime → something else (PlainDateTime, AbstractDateTime, CalendarDateTime) |
Agreed. I'd add ZonelessDateTime to the "something else" list, with the goal of helping users understand that it's the type to use when you want the date and time but don't don't know (or don't care about) the time zone. PlainDateTime is a more subtle version of the same idea; you only need something "plain" if the "full" (or spicy!) thing is not available or appropriate. I'd avoid
I agree in principle, but "Event" is used in the web platform (e.g. DOM events) to mean "something that happened in an interrupt-driven fashion" without LocalDateTime's emphasis on "in a real place". So I'd be inclined to avoid "Event" in Temporal to avoid that potential confusion. |
Beware IF we were to go and rename DateTime to “something else” we’d also have to rename Date and Time (and possibly MonthDay and YearMonth) for consistency. |
Also LocalDateTime is so much more than just a Date and Time that I’m not convinced that’s the way to go. How about the other extreme: AbsoluteZonedDateTime And in literature we can refer to it by its nickname: AZDT 😀 |
I disagree, I wouldn't see a problem with having e.g. DateTime, PlainDateTime, Date, and Time. My reasoning is that there's no possibility to have a 'spicy' (as Justin put it) Date and Time.
Fair enough, something else along the lines of Event would satisfy that concern, but 👎 to AZDT 😄 |
Some ideas. Option 1: Based on the Data Model
These names accurately reflect the data model, which I think can help developers think about the relationship between these types more effectively. I expanded "DateTime" to "DateAndTime" to make it look less friendly. Option 2: Java-style
These names are based on the equivalent types in java.time. Option 3 : Based on function
These names are intended to reflect the use cases. EDIT 2020-09-02: I changed "DateTime" to "Event" to more accurately reflect the mental model. |
I'm seeing several folks above mention this pattern:
Seems like a good pattern for discoverability, IMHO. I support this pattern. I don't have a strong opinion about Xxx, but I tried to order them above in my (slightly) preferred order. |
👎 Zoneless, Civil, Theoretical, Nonlocal, Ideal, Wall edit: I've kind of come around to AbstractDateTime. I also still like CalendarDateTime because it's the most descriptive of the names, in my opinion, although I will definitely concede that it's confusing because it implies that the other types don't have calendars. |
Consistency is key, so if we end up renaming So we’re back at prefixing the basic types (DateTime , Date & Time) just to benefit something that is more specialized and thereby suggesting its use for cases it unsuited for. For those reasons I’m against prefixing the current objects and for contemplating suitable names for Given it’s decided semantics as some event on the absolute timeline in sone specific place I find LocalDateTime quite appropriate. Alternatively |
What I posted above as Option 1 is currently my favorite. #707 (comment) DateTime becomes DateAndTime, for reasons I've discussed previously: DateTime is an overloaded term in programming, so in my opinion, it is a good idea not to use that term at all. We can use DateAndTime to emphasize the nature of this type. LocalDateTime becomes LocalTimestamp (or LocalAbsolute), accurately reflecting its data model. I like the prefixed "Local" instead of "Zoned" because the type also carries a calendar, not just a time zone, relative to the regular Timestamp/Absolute. "Local" reflects that this is a localized timestamp in multiple ways. |
It will be very awkward to have a conjunction in the name; “DateAndTime” seems like a poor choice. |
First choice: A name like Event. EventTime and Occurrence are not quite it, but maybe we can come up with one? Could we actually reuse Instant for this, or even Moment (with apologies to moment.js)? (Thesaurus suggests some others that I don't like: Incident? Happening? Circumstance? Occasion?) Second choice: LocalDateTime → DateTime, DateTime → AbstractDateTime. (I disagree that this would make it necessary to rename Date and Time as well. It's not possible to have a zoned Date or a zoned Time, so there's no ambiguity.) Last choice: use the Java names but keep Timestamp instead of Instant. I think "Local" and "Civil" had already been rejected years ago for good reasons, and especially Local could be argued to be a good name for (the types that are currently called) LocalDateTime or DateTime. |
It’s not about ambiguity, it’s about consistency. It makes AbstractDateTime seem different from Date and Time where it is very similar and it make (Local)DateTime seem similar to Date and Time where it is very different. It also puts (Local)DateTime into a spot of pre-eminence it’s not properly in. For all these reasons (and a few I haven’t thought of yet) this is option 100 in my order of preference right after naming all out classes |
As a matter of fact I’d like to suggest not changing the name of |
I think it'd be helpful to be explicit about the prioritization framework we're using to guide our preferences. Here's mine, in ranked order:
With these priorities in mind, my current preference is:
Why?
But honestly I care more about the priorities than specific names. I'd be happy with other names that fulfill the same goals. |
@justingrant Do you feel that my proposed
I can also see some merits about naming the types based on the mental model / intended use case (e.g. Event). |
Why I'm not super fond of
|
Nope. I think The fact that LocalDateTime is implemented using a timestamp is really just an implementation detail. From the user's perspective, a LocalDateTime is a date, a time, an offset, and a time zone. Using at least some of those words in the name will help discoverability. And if the zoneless type has "Date" and "Time" in the name and the zoned type does not, it's perhaps the worst possible discoverability outcome.
I'm not sure this is a bad thing. Discoverability workflows have 1-2 steps:
Here's another way to think about the discoverability process:
Anyway, I see FWIW, Joda Time (which was the basis of Java.time) used BTW, although I prefer |
But I belive the charter of LocalDateTime is to represent an event (timestamp) that occurred at a particular location (time zone and calendar system). The fact that it works nicely with date/time timezone math is a convenient afterthought.
I disagree with that premise. Unlike what's currently called DateTime, a LocalDateTime represents an unambiguous instant in time; it just has a location (time zone and calendar system) attached to it. It's a fallacy to think of it as a date, time, offset, and time zone, because not every combination of those elements can be represented by a LocalDateTime (say 2:30am the night of a spring forward DST transition). |
I actually wasn't thinking of math here. I was more thinking about Date and Time fields. Many developers wouldn't expect a type named "XxxTimestamp" to have those fields. But I also think it's fine to think of it as an Absolute+TimeZone. Both viewpoints are correct, which I actually think is an advantage of LDT because I expect both viewpoints will be present among users of Temporal. Some developers will naturally gravitate to one view or the other, and I think that's OK. BTW, this reminds me of an insight I heard from an old colleague that I think applies here:
Anyway, my point in the comment above was that from the junior-developer POV of looking at the outside of the type, LDT feels more like today's DateTime and less like today's Absolute. For these developers, the word "Timestamp" would make it harder to discover this type.
I don't think I agree with this statement. Aggregates can place restrictions on their content without invalidating the essence of the combination. A userland |
The "What is it?" versus "What does it do?" insight is very relevant here.
I want programmers to think about date getters as being tied to the calendar system. Types that carry a calendar are equivalent to those that have date getters and support date math. "LocalTimestamp" is descriptive, because "local" suggests both a time zone and a calendar system. When I was chatting with Ujjwal the other day, I suggested that we could name the Absolute -> LDT transition function "localize", taking the two arguments (time zone and calendar), to emphasize what "local" means. For comparison, I wouldn't like "ZonedTimestamp", because it suggests a Timestamp+TimeZone data model; however, we made the very significant decision to also include a Calendar in the LDT data model. Similarly, "CalendaredTimestamp" is misleading because it does not indicate the presence of a time zone. |
While I’m Ok with
I also don’t care about what the current experts in the field think too much. And here is why: Experts in any field retire and get old and new ones grow. As such “what is expected and known” is actually not that important because it changes over time. For example when I was young literally literally meant literally but these say the meaning has changed to figuratively and we no longer have a word meaning literally. Much more important is the mental mode we establish and that this is internally consistent. If we do that, then the coming generations of experts in the field have a much easier time to emerge. Our mental model is that:
Just because there is a randomness factor introduced called DST that makes that date & time & timezone tuple not entirely unambiguous therefore forcing us to use an absolute in the polyfill does not change that mental model. So while at the start So as a matter of fact the statement:
is entirely misguided in my view. On the contrary: the charter of |
Meeting 2020-20-15: "Plain" wins! Also we'll use that same prefix on MonthDay and YearMonth too for consistency. Final names are: EDIT: conversion methods will also be renamed, e.g. |
What did we decide for the conversion methods within the
|
Hmm, we didn't talk about that, but I think it'd be |
I'm confused, why is a twitter poll being used as the deciding factor? |
It's just one factor. All three names polled were ones we thought might work. A non-representative (albeit more representative than Champions+Reviewers+GH-Commenters who are much more sophisticated than the median JS developer) sample of 166 developers preferred "Plain" over the alternatives by a wide margin. This isn't decisive but was a helpful signal that "Plain" would be a widely-acceptable prefix. Looking through the "Other" suggestions on Twitter didn't bring up any other names we thought might be more accepted. Therefore, in today's meeting we were able to get to consensus that "Plain" would be the best choice. |
79 preferred Plain, 30 preferred Floating, 30 preferred Civil. The trend certainly implies this spread, but that's a pretty small sample size and difference. It'd be nice, prior to the relevant plenary, to gather more input about the name (including, ideally, the ability for folks to suggest things). |
We’ve been through several iterations of this discussion. We’ve changed this a number of times. We’ve also asked the committee for input on a few occasions. This decision wasn’t left to a poll, but rather we used a poll as the final piece of input to come to a conclusion. So I’m strictly against revisiting this again. The time for this has passed. We’ll go to the committee and ask for agreement of course. And the committee will then have to come to consensus. If someone wants to withhold consensus due to the name of these classes, then so be it. But until then, revisiting this is not productive. |
I don't believe I asked for anything to be revisited - I asked for more data to be gathered to present to plenary at the appropriate time. |
Do you have a proposal for how to gather that data? |
There are 11.7 million active JavaScript developers. In our poll, we captured 166 of them. The margin of error of this sample is 8% with 95% confidence. Therefore, Plain has a statistically significant lead. |
@sffc i believe that presumes that the polled population (twitter users who happened to see the poll) does not vary significantly from the larger group of JS developers. @pipobscure I'm not sure. perhaps a poll that lasts longer than a day or two would help obtain more results, especially if it were posted on multiple venues besides Twitter (not sure if this one was, or not). |
The new name is decided and #700 has been updated with the new name, so I'm going to close this issue. Thanks everyone for your help picking "ZonedDateTime" as the name of this type! |
I'd like to keep this open, the other types still need to be renamed to "Plain", so this is a good issue for anyone to pick up without lots of prior knowledge of Temporal. |
OK sounds good. |
Although, actually: would you be OK if I closed this one and opened up a new issue specifically for the |
Sure, that works too. |
To summarize this issue before closing it, here's the final names that were decided: LocalDateTime => ZonedDateTime #1072 will track the work to rename the unzoned types. |
In #700, @InExtremaRes asked:
I figure this won't be the last question/suggestion about the name of this type, so opening up this issue to coalesce feedback about naming. The current name is just a placeholder.
The text was updated successfully, but these errors were encountered: