deprecate deprecated?
Jonathan M Davis
jmdavisProg at gmx.com
Mon Nov 12 10:31:07 PST 2012
On Monday, November 12, 2012 12:09:34 monarch_dodra wrote:
> IMO, there *NEEDS* to be some way of saying
> - "this _will_ be deprecated soon (marked for deprecation), you
> should consider migrating to something else. here is you warning."
> and
> - "This is already deprecated. Here is your error. You can
> *still* use it with -d, but migrate away soon, because this
> function is about to disappear"
>
> ----
> If you can't make this distinction, then you also run into the
> danger of not breaking anybody's code when deprecating stuff, but
> having to keep deprecated stuff around forever.
Sure, it would be nice to have that distinction, but regardless of what you
do, if the user doesn't fix their code, it'll break eventually when the
deprecated symbol is removed. Because we have -d, they can completely ignore
deprecated stuff even though it currently gives an error, which puts them in
exactly the same boat that they'll be if they use -d if using deprecated stuff
is a warning, and if they don't use -d, they're always being bugged about it,
so it's basically the same as -d now as far as compilation goes, but they'll
be made aware of the problem.
The _only_ downside that I see is that if someone is stupid enough to leave in
a sea of warnings (which is much harder to do in D than other languages due to
Walter's dislike of warnings), the deprecation messages might be buried. But
as long as you can see them and/or you compile with -de (or whatever the flag
is that makes them errors again), then I don't see problem.
The fact that you go from warning to gone (if no extra flags are used) isn't a
problem as far as I can see. It's really not that much different from what we
have now as far as people ignoring fixing deprecated stuff goes. It just means
that people's code won't break immediately when stuff is deprecated.
And sure, there's a possibility that stuff will stick around for a ridiculously
long time, but we have that problem _now_ when deprecated generates an error
by default.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list