On Wednesday, October 22, 2014 14:10:02 Walter Bright via Digitalmars-d wrote:
On 10/22/2014 1:28 PM, Jonathan M Davis wrote:
> I can understand that, but it does seem a bit risky in this > case. The > suggestion of creating a warning for it seems like a good > one, since it > allows you to debug like that but needles you to not leave it > that way.

I don't want deliberately written debug code to produce needling warnings. The Boy Who Cried Wolf comes to mind. The feature provides for a valid use
case, one that is pretty hard to do any other way.

Such warnings should go into a separate linting tool.

That's actually one of the few cases where I would have said that actually having a warning made sense as opposed to making it an error or leaving it to a lint tool. Since no one should be leaving warnings in their code, it seems to me that having a warning for something that's temporarily okay to do but not okay to leave in your code is just about the only valid use case for warnings (particularly if deprecation-related stuff is separate like it is in D). So, I'd definitely be in favor of having a warning in this case, but I don't care enough to fight for it either, particularly since I almost never use debug blocks (though their ability to bypass pure will probably make it so that I use them at least periodically).

- Jonathan M Davis

Reply via email to