From: Ryan Davis Date: 2010-09-06T10:23:34+09:00 Subject: Re: Life Phases of a Ruby Method On Sep 5, 2010, at 14:06 , Dan Rathbun wrote: > (1) Immature What's the point of this phase, at least as far as mapping out lifecycles of code? Deprecated/Retired/Deceased makes sense to me (with reservations below) to have an organization formalize their API support lifecycle... Beyond that, I don't see the point. > (3) Deprecated > [*] A method that is not recommended for new programs, but still > exists. > [*] It may have a replacement method that should be used in it's > place. > [*] Calling it, may issue a "Deprecated" Warning to $stderr when > called, if $VERBOSE == true. > [*] The warning should inform coders as to the name of the replacement > method, and/or the reason it has been deprecated. > [*] For backward compatibility, the method should still function, > during the deprecated "grace period," giving developers time to migrate > their code to using the new method. > [*] A module or class definition can contain an array Constant of > "Deprecated" method names, that can be queried. > > (4) Retired > [*] A method that is not allowed to be used, and is overriden to > automatically call a replacement method. > [*] Calling it, should issue a "Retired" Warning to $stderr when > called, if $VERBOSE != nil. > [*] The warning should inform coders that the method called is > "Retired", and that the replacement method was called in it's place. > [*] The warning may also seek to persude the programmer to update > their code, before the method becomes deceased (after the "grace period" > ends.) > [*] A module or class definition can contain an array Constant of > "Retired" method names, that can be queried. Why differentiate between the two? Saying "is not allowed to be used" but then you allow it and do the right thing for the user doesn't make sense to me. I think in almost all my cases, I'd rather go from Deprecated (but with the warning semantics of Retired) to Deceased and not bother with the Retired step that doesn't make sense to me. Additionally, not all retired code will properly map to the new API as-is... further complicating the matter.