a small study of "deprecate"

Jonathan M Davis jmdavisProg at gmx.com
Thu Nov 8 01:22:24 PST 2012


On Thursday, November 08, 2012 10:12:52 monarch_dodra wrote:
> So you are saying: keep the current behavior, but also print a
> warning in -d mode?

It makes far more sense for deprecated stuff to warn by default rather than 
give an error. It's the fact that it gives an error that makes it so hard to 
use in Phobos right now. If it just warned, deprecating stuff would encourage 
people to use new stuff but not break code.

I do agree though that turning off deprecation messages entirely is ugly. The 
result at present if you have deprecated stuff in your code, you ethire get hit 
with errors due to deprecated stuff and fix your code, or you use -d to shut it 
up, and then see nothing and have no idea what you need to fix in your code. 
We've missed cases in Phobos where deprecated stuff was still being used 
because Phobos compiles with -d. -d really is not a great flag. If we want to 
fix the flags, it should be warn by default and error with a specific flag. I'd 
suggest making it -dw to match -w, but I don't much care what the name is so 
long as it's reasonable.

- Jonathan M Davis


More information about the Digitalmars-d mailing list