[phobos] Deprecation of std.date
Jonathan M Davis
jmdavisProg at gmx.com
Sun Jan 16 18:36:57 PST 2011
On Sunday 16 January 2011 18:16:56 Walter Bright wrote:
> Jonathan M Davis wrote:
> > On Sunday 16 January 2011 11:48:36 Walter Bright wrote:
> >> Jonathan M Davis wrote:
> >>> Regardless, there will be one function - the version
> >>> std.file.lastModified which just takes the file name - which will break
> >>> the build of anyone using it, because the only thing changing in its
> >>> signature is its return type (SysTime instead of d_time), so there's no
> >>> way to overload it. Fortunately, however, I think that it's the only
> >>> function in that boat.
> >>
> >> It needs to have a different name if its return type changes.
> >
> > Okay, then. If that's how you'd prefer to do it, then I guess that that's
> > what I'll do - though nothing immediately comes to mind as an alternate
> > name for lastModified. I'll have to brainstorm a bit, I guess.
>
> The reason is to not muck up existing user code, which I think is a
> worthy goal.
Oh, I agree. It's just that I've been thinking more along the lines of avoiding
breaking changes unless it gets in the way to not make a breaking change. For
instance, creating a new overload is easy enough, as is creating an alias when
renaming a function, but being forced to rename a function just because the
return type is changing is definitely getting in the way, so it wouldn't really
have occurred to me to rename it unless I already thought that the name needed
to be improved. But if we're taking the tact of never breaking user code without
first deprecating whatever was there before, then we have deal with renaming
functions and the like if that's what necessary to maintain the old function in
the short term.
I guess that overall, I've been viewing the deprecation path as nice but not
absolutely necessary, whereas you're viewing it as necessary. So, I'll just have
to keep that in mind and change how I've been going about it. However, IIRC in
this case, lastModified is the only change which would be a breaking change, so
it doesn't require me to change much of what I've done except find a new name for
lastModified.
- Jonathan M Davis
More information about the phobos
mailing list