On Wed, 17 Aug 2011, Philippe Marschall wrote:
On 16.08.2011 19:51, Igor Stasenko wrote:
Hello,
i know that we're already having #deprecated: , #deprecated: on: in: etc
but one thing what i think useful about annotations that it is a way to indicate that method is deprecated without showing a warning.
The problem with using messages, that if you deprecate something which used quite often by code, you will be spammed with deprecation warnings all the time.
So, i think that in addition to messages, we can use these annotations, to indicate deprecated methods, in places where showing warning(s) are not feasible (for instance you cannot deprecate Deprecation>>showWarning, because it will lead to infinite recurtion)
There could be variations in same way as with messages:
<deprecated> <deprecated: '...' on: '..' in: '..'>
etc.
What you think?
How would that help anybody to find out whether they are relying on deprecated methods? This seems like a big step backwards form a user point of view. Suddenly a method is gone and you didn't get a warning. You are you supposed to check for deprecated methods? Debug each and every one of your message sends?
Yeah you could write tools support but we both know this isn't gonna happen.
What about using "soft deprecation". If would raise an exception which would have no default action, but from the TestRunner (or other tools) you'd be noticed that your code relies on deprecated methods. So if your code has good test coverage, then you'll know that you have to update your code. For example: foo self softDeprecated: 'This method shouldn't be used anymore. Use #bar instead." ... Levente
Cheers Philippe