Thread overview | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
September 26, 2014 Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
As Walter mentioned in a recent pull request discussion [1], the first formal deprecation protocol we came up with for language changes looked something like this: 1. remove from documentation 2. warning 3. deprecation 4. error (The "remove from documentation" step is a bit questionable, but that's not my point here.) However, in the meantime deprecations were changed to be informational by default. You now need to explicitly need to pass -de to turn them into errors that halt compilation. Thus, I think we should simply get rid of the warning step, just like we (de facto) eliminated the "scheduled for deprecation" stage from the Phobos process. Thoughts? Best, David [1] https://github.com/D-Programming-Language/dmd/pull/4021#issuecomment-56758916 |
September 26, 2014 Re: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | On Fri, Sep 26, 2014 at 04:15:40PM +0000, David Nadlinger via Digitalmars-d wrote: > As Walter mentioned in a recent pull request discussion [1], the first formal deprecation protocol we came up with for language changes looked something like this: > > 1. remove from documentation > 2. warning > 3. deprecation > 4. error > > (The "remove from documentation" step is a bit questionable, but > that's not my point here.) > > However, in the meantime deprecations were changed to be informational by default. You now need to explicitly need to pass -de to turn them into errors that halt compilation. Thus, I think we should simply get rid of the warning step, just like we (de facto) eliminated the "scheduled for deprecation" stage from the Phobos process. > > Thoughts? [...] I think the warning stage is still necessary. Users need to be informed well ahead of time that something is going to be deprecated, before it starts breaking their builds (which, according to recommended usage, shouldn't be compiling with -d). We'll get a lot fewer angry users this way. Recently there was a case of a deprecation that broke the default build of a large project, and the author was surprised (and not very happy) to learn that something had been "suddenly" deprecated -- because the deprecation warnings wouldn't even show up unless you specifically compile with -dw. I think now -dw has been made default, which is the right step forwards IMO, so it should be kept that way. T -- I'm still trying to find a pun for "punishment"... |
September 26, 2014 Re: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | On 9/26/14 12:15 PM, David Nadlinger wrote: > As Walter mentioned in a recent pull request discussion [1], the first > formal deprecation protocol we came up with for language changes looked > something like this: > > 1. remove from documentation > 2. warning > 3. deprecation > 4. error > > (The "remove from documentation" step is a bit questionable, but that's > not my point here.) > > However, in the meantime deprecations were changed to be informational > by default. You now need to explicitly need to pass -de to turn them > into errors that halt compilation. Thus, I think we should simply get > rid of the warning step, just like we (de facto) eliminated the > "scheduled for deprecation" stage from the Phobos process. > > Thoughts? Case against: https://github.com/D-Programming-Language/phobos/pull/2254#issuecomment-52764718 -Steve |
September 26, 2014 RE: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger Attachments:
| The only one and right solution is print warning message by default ----- Původní zpráva ----- Od:"David Nadlinger via Digitalmars-d" <digitalmars-d@puremagic.com> Odesláno:26. 9. 2014 18:20 Komu:"digitalmars-d@puremagic.com" <digitalmars-d@puremagic.com> Předmět:Deprecations: Any reason left for warning stage? As Walter mentioned in a recent pull request discussion [1], the first formal deprecation protocol we came up with for language changes looked something like this: 1. remove from documentation 2. warning 3. deprecation 4. error (The "remove from documentation" step is a bit questionable, but that's not my point here.) However, in the meantime deprecations were changed to be informational by default. You now need to explicitly need to pass -de to turn them into errors that halt compilation. Thus, I think we should simply get rid of the warning step, just like we (de facto) eliminated the "scheduled for deprecation" stage from the Phobos process. Thoughts? Best, David [1] https://github.com/D-Programming-Language/dmd/pull/4021#issuecomment-56758916 |
September 26, 2014 Re: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Kozák | Daniel Kozák:
> The only one and right solution is print warning message by default
I am asking for this since some years.
Bye,
bearophile
|
September 26, 2014 Re: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Fri, Sep 26, 2014 at 09:16:50PM +0000, bearophile via Digitalmars-d wrote: > Daniel Kozák: > > >The only one and right solution is print warning message by default > > I am asking for this since some years. [...] In git HEAD, dmd now allows use of deprecated features and displays a warning by default. Only if you compile with -de, it will become an error. T -- "I'm not childish; I'm just in touch with the child within!" - RL |
September 26, 2014 Re: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | H. S. Teoh:
> In git HEAD, dmd now allows use of deprecated features and displays a warning by default.
I meant I'd like by default all warnings to be shown :-)
Bye,
bearophile
|
September 29, 2014 Re: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On Friday, 26 September 2014 at 16:31:52 UTC, H. S. Teoh via Digitalmars-d wrote:
> I think the warning stage is still necessary. Users need to be informed
> well ahead of time that something is going to be deprecated, before it
> starts breaking their builds (which, according to recommended usage,
> shouldn't be compiling with -d). We'll get a lot fewer angry users this way.
Wait, what? I was talking specifically about the stage as a capital-W-warning, i.e. something that shows up only when the user specifies -w or -wi. Deprecations are informational by default now, unless you explicitly specify -de.
As far as I can see having deprecation messages as Warnings first actually leads to *more* build breakage (as many more people are building with -w than with -de) and less time for adapting code before it is made an error (because -w/-wi is not the default).
Thus, I don't see any justification left for making deprecation messages Warnings first.
David
|
September 29, 2014 Re: RE: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Kozák | On Friday, 26 September 2014 at 21:13:14 UTC, Daniel Kozák via Digitalmars-d wrote:
> The only one and right solution is print warning message by default
This is actually what is done for deprecations already. -dw is the default. We just currently don't use them this way, for whatever reasons.
David
|
September 29, 2014 Re: Deprecations: Any reason left for warning stage? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Friday, 26 September 2014 at 18:38:43 UTC, Steven Schveighoffer wrote:
> Case against: https://github.com/D-Programming-Language/phobos/pull/2254#issuecomment-52764718
I don't think this is relevant for this discussion at all. Vladimir asked for advance notice in terms of docs before anything changes about the actual implementation. Making stuff a Warning addresses this just as much or as little as making it a Deprecation does.
To put it differently: Were the issue in question a language change (under the current deprecation process), Vladimir would have complained all the same about DMD spewing Warning messages. You might even be able to construe it as an argument in favor of dropping the Warning stage – at least deprecation warnings can easily be filtered out without hiding potentially useful Warnings that might indicate something wrong with your code.
David
|
Copyright © 1999-2021 by the D Language Foundation