On Wednesday, October 11, 2017 23:06:13 Johan Engelen via Digitalmars-d-
learn wrote:
> I am disappointed to see functions being deprecated, without an
> extensive documentation of how to rewrite them for different
> usage of the deprecated function. It makes me feel that no deep
> thought went into removing them (perhaps there was, I can't tell).
>
> One has to go and browse through the different version _release
> notes_ to find any documentation on how to rewrite them. It would
> have been much better to add it (aswell) to the deprecated
> function documentation.
>
> I have the same problem for std.string.squeeze. The release notes
> only say how to rewrite the `squeeze()` case, but not the
> `squeeze("_")` use case. I guess `uniq!("a=='_' && a == b")` ?
> Great improvement?

Normally, when something is deprecated, replacing it is fairly
straightforward, and documentation usually isn't need at all (simply
pointing someone to the new function generally suffices). Unfortunately,
that isn't really the case here. It was decided years ago that they pattern
functions in std.string should be replaced by regex stuff, but no one ever
did it. It was recently decided to just rip them out anyway, which I have
very mixed feelings about, since I agree that they should go, but how to
replace their functionality in your own code is not necessarily obvious. We
certainly didn't provide functions that did the same thing but took regexes,
which was originally the idea for what would replace them but was never
implemented. IIRC, the only reason that there's _any_ explanation is because
the person who created the PR was pushed to create some examples.

The way this was handled is not very typical of how deprecations are
handled.

- Jonathan M Davis

Reply via email to