On 17 August 2011 14:26, Levente Uzonyi <[email protected]> wrote: > 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." > ... > +1
this seems like a nice way to solve the problem. So, we can add a Deprecation subclass, say SoftDeprecation and then modify test runner to catch all deprecations while running tests. Because right now we don't have a way to deprecate stuff, which is used often: things like browser protocol, system navigation, SmalltalkImage, Morphic, Canvas etc etc.. -- Best regards, Igor Stasenko AKA sig.
