|Posted by TechnoZeus||PermalinkReply|
Perhaps this is already implemented.
Since I'm not working with any "old code" I haven't even looked...
but nonetheless, I thought it was worth mentioning,
just in case.
As I understand it from the documentation, deprication is an all or nothing situation as it stands.
By this, I mean that one can swith the allowance of pedricated features on or off, but nowhere in-between.
I would like to propose that the concept of deprication levels be entertained.
A lower level would be less important to phase out,
and a higher level would be more important to phase out.
When a feature is initially depricated, it would be given a low deprication level such as 1, or perhaps 2 or 3 if it's something that everyone agrees needs to go.
As more features are depricated and older depricated features are phased out, occasionally,
all depricated features would increase in level by 1,
or perhaps just those that are known to be reletively well phased out.
This would allow asynchronous phasing out of depricated features,
while giving the software developer more control as well as some built-in guidance,
when it comes to choosing what needs phased out next.
For example, while the "-d" compiler switch allows all depricated features,
perhaps "-d3" could allow only those depricated features with a level of 3 or lower,
allowing newly depricated features to be put on a back burner, so to speak,
while "-d300" would only disallow features with a deprication level above 300,
allowing them to concentrate on phasing out the most extreme cases first,
before reducing down to something like "-d250" and starting on the next batch.
This would be of absolutely no use to me personally, at this time,
but in the discussion about adding ":=" as a value assignment operator,
when I mentioned the possibility of depricating the use of "=" in cases where it also
functions as a value assignment operator,
and it occurred to me that some day I may have code that needs something like that phased out.
That made me think about what it must be like to have several things needing to be phased out at once,
such as is likely the case for people using a lot of "C-like" code,
possibly adapted from older C code that they wanted to migrate into the D language.
I would guess that in such cases, the ability to allow "some" deprecated features would be handy.
One further note:
I would suggest avoiding having gaps in the deprecation levels.
For example, if there is only one feature with a deprecation level of exactly 97,
and that feature is phased out while there are still other features with higher deprecation levels,
then those with higher deprecation levels should have their level reduced accordingly,
to close the gap.