Comments (8)
Okay, well, let's skip 0.4.x for now then.
from chrono.
We can also rename them all to
with_*
. However we have 26 methods that currently follow a convention thatwith_
keeps the type the same and modifies some component of the date/time. It seems nice to maintain a distinction.
Hmmm, not sure I want to overindex on maintaining this distinction? It's one factor, but not sure how important it should be.
Can you add another table that with these with_
methods to we can compare?
from chrono.
Those would be:
NaiveDate::with_year
NaiveDate::with_month
NaiveDate::with_day
NaiveDate::with_ordinal
NaiveTime::with_hour
NaiveTime::with_minute
NaiveTime::with_second
NaiveTime::with_nanosecond
NaiveDateTime::with_year
NaiveDateTime::with_month
NaiveDateTime::with_day
NaiveDateTime::with_ordinal
NaiveDateTime::with_hour
NaiveDateTime::with_minute
NaiveDateTime::with_second
NaiveDateTime::with_nanosecond
DateTime::with_year
DateTime::with_month
DateTime::with_day
DateTime::with_ordinal
DateTime::with_time
DateTime::with_hour
DateTime::with_minute
DateTime::with_second
DateTime::with_nanosecond
DateTime::with_timezone
Time-rs uses replace_
for most of these.
from chrono.
Okay, I think it sounds good to stick with with_
for same-type and use at_
/in_
for different-type. Let's introduce the new names on main with deprecations?
from chrono.
Wow, that is a fast decision 😄. But I think it is going to be a nice improvement.
Let's introduce the new names on main with deprecations?
Those deprecations are going to hit everyone who uses chrono. I am afraid at some point we are going to chaise users away if we keep causing too much churn.
from chrono.
I mean, it will still be churn if we change them only in 0.5, except that will be a lot more churn all at the same time? Better to smooth it out over time (and give us a chance to get feedback on the change), IMO. Maybe we can split these changes out?
BTW I do kind of like the assume_
prefixes from time-rs because they IMO more clearly/explicitly convey the intended semantics. So maybe we should copy those instead of in_()
?
from chrono.
I mean, it will still be churn if we change them only in 0.5, except that will be a lot more churn all at the same time? Better to smooth it out over time (and give us a chance to get feedback on the change), IMO.
I can't deny it is going to have to happen at some point. And from our perspective doing it on the 0.4 branch brings advantages.
But I really do think there is a limit to what at least a portion of our users will tolerate. And I don't want to find out where that limit lays.
If we deprecate methods because they can lead to easy mistakes or unexpected panics that seems okay to do. Even users that are annoyed by the deprecation warnings can see it is at least done for a good reason.
Doing deprecations because we consider a new name to be nicer is going to be a much harder sell.
Also duplicating 13 methods is not going to make our documentation any clearer.
The difficult part here is that I am arguing for not doing it on 0.4 while personally I don't mind it much if changes are smoothed out over time.
from chrono.
BTW I do kind of like the
assume_
prefixes from time-rs because they IMO more clearly/explicitly convey the intended semantics. So maybe we should copy those instead ofin_()
?
I'd like to test both and see how it looks in some sample code.
from chrono.
Related Issues (20)
- the trait bound `DateTime<Utc>: OptionFrom/ToWasmAbi` is not satisfied when targeting wasm32 HOT 3
- 0.5: Consider using smaller types for arguments
- Make Weekday::num_days_from public HOT 2
- Add a method to the `Offset` trait to return DST info HOT 5
- 0.5: Add a `LocalOffset` type HOT 4
- Verification of published packages HOT 2
- `gh-pages` branch HOT 3
- Releases has problematic naming of 0.4.8 release which puts it at the top HOT 3
- 0.4.37 semver-incompatibly removes trait bounds on `DateTime` HOT 10
- How do I get the raw underlying bytes of a `NaiveDate` HOT 4
- Parsing from string to DateTime - input is not enough for unique date and time HOT 3
- TimeDelta always returning a PT in seconds HOT 2
- NaiveDate::years_since wrong documentation
- Saturating operations HOT 9
- Datetime Parse Error when converting rfc2822 date to chrono Datetime HOT 2
- Extra slow Utc to Local conversion HOT 6
- Wasm support for NaiveTime, NaiveDate and alike HOT 2
- Bincode 2.0.0 support HOT 2
- Need Duration to Represent Time in Months/Years HOT 1
- DelayedFormat: Panic in rendering
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrono.