|
View:
New views
13 Messages
—
Rating Filter:
Alert me
|
|
|
Unused code removal - confirmationHi,
If I notice some unused/dead piece of code somewhere, it is ok to go ahead and remove it? I haven't done any changes yet that were not against any JIRA - so just wanted to double check. -- Roshan |
|
|
Re: Unused code removal - confirmationYou might want to deprecate any functions that are not being called,
rather than remove them. Roshan Dawrani wrote: > Hi, > If I notice some unused/dead piece of code somewhere, it is ok to go > ahead and remove it? > > I haven't done any changes yet that were not against any JIRA - so just > wanted to double check. > > -- Roshan --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
|
|
|
Re: Unused code removal - confirmationroshandawrani@... schrieb:
> Oh, my question was more about dead code inside methods, imports, private stuff, etc.. > > I wouln't go around removing anything on any sort of interface. imports and private stuff is ok. What else? bye blackdrag -- Jochen "blackdrag" Theodorou The Groovy Project Tech Lead (http://groovy.codehaus.org) http://blackdragsview.blogspot.com/ --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
|
|
|
Re: Unused code removal - confirmationIn general, if you really notice code that is truely and surely
unused, yes, that's a good thing to do some spring cleaning. Unused imports, unused variables, etc. are easy to spot as not needed, and can safely be removed. Private methods that Groovy doesn't call anywhere could also be removed. Then, things like public methods that Groovy doesn't use doesn't mean this is not used by anyone though. On Sun, Oct 25, 2009 at 15:52, <roshandawrani@...> wrote: > Some useless code at some place that I could be sure of removing. > > I am not in fromt of pc right now but I think in APP#parameter(), it was creating useless VariableExpression objects called leftExpression. That kind of stuff, if I notice somewhere. > > > ------Original Message------ > From: Jochen Theodorou > To: dev@... > ReplyTo: dev@... > Subject: Re: [groovy-dev] Unused code removal - confirmation > Sent: Oct 25, 2009 7:16 PM > > roshandawrani@... schrieb: >> Oh, my question was more about dead code inside methods, imports, private stuff, etc.. >> >> I wouln't go around removing anything on any sort of interface. > > imports and private stuff is ok. What else? > > bye blackdrag > > -- > Jochen "blackdrag" Theodorou > The Groovy Project Tech Lead (http://groovy.codehaus.org) > http://blackdragsview.blogspot.com/ > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > > --------------------------------------------------- > Sent from BlackBerry -- Guillaume Laforge Groovy Project Manager Head of Groovy Development at SpringSource http://www.springsource.com/g2one --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: Unused code removal - confirmationI would suggest to keep even unused private methods. Groovy code base
is really big and sometimes you can find interesting/useful knowledge in unused methods or eeven commented blocks. Just my 2c. On Sun, Oct 25, 2009 at 4:25 PM, Guillaume Laforge <glaforge@...> wrote: > In general, if you really notice code that is truely and surely > unused, yes, that's a good thing to do some spring cleaning. > Unused imports, unused variables, etc. are easy to spot as not needed, > and can safely be removed. > Private methods that Groovy doesn't call anywhere could also be removed. > > Then, things like public methods that Groovy doesn't use doesn't mean > this is not used by anyone though. > > > On Sun, Oct 25, 2009 at 15:52, <roshandawrani@...> wrote: >> Some useless code at some place that I could be sure of removing. >> >> I am not in fromt of pc right now but I think in APP#parameter(), it was creating useless VariableExpression objects called leftExpression. That kind of stuff, if I notice somewhere. >> >> >> ------Original Message------ >> From: Jochen Theodorou >> To: dev@... >> ReplyTo: dev@... >> Subject: Re: [groovy-dev] Unused code removal - confirmation >> Sent: Oct 25, 2009 7:16 PM >> >> roshandawrani@... schrieb: >>> Oh, my question was more about dead code inside methods, imports, private stuff, etc.. >>> >>> I wouln't go around removing anything on any sort of interface. >> >> imports and private stuff is ok. What else? >> >> bye blackdrag >> >> -- >> Jochen "blackdrag" Theodorou >> The Groovy Project Tech Lead (http://groovy.codehaus.org) >> http://blackdragsview.blogspot.com/ >> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> >> >> --------------------------------------------------- >> Sent from BlackBerry > > > > -- > Guillaume Laforge > Groovy Project Manager > Head of Groovy Development at SpringSource > http://www.springsource.com/g2one > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: Unused code removal - confirmation> I would suggest to keep even unused private methods. Groovy code base
> is really big and sometimes you can find interesting/useful knowledge > in unused methods or eeven commented blocks. I'm fairly new around here, so I understand when my 2c is ignored... but here it is: this is what version control is for. commented out code and unused private methods are noise in the signal. If something is useful/interesting then document it in a test. For private methods... my preference is that if you write code that depends on someone else's privates, then write a test in your code to assert that those privates exists... then when someone refactors those privates away (or deletes it b/c it is unused) they will get a test-time failure from your component instead of a surprise at runtime. If you don't like the idea of asserting that some other class has the correct private implementation then the solution is to not depend on it! -- Hamlet D'Arcy hamletdrc@... On Sun, Oct 25, 2009 at 11:14 AM, Alex Tkachman <alex.tkachman@...> wrote: > I would suggest to keep even unused private methods. Groovy code base > is really big and sometimes you can find interesting/useful knowledge > in unused methods or eeven commented blocks. > > Just my 2c. > > On Sun, Oct 25, 2009 at 4:25 PM, Guillaume Laforge > <glaforge@...> wrote: >> In general, if you really notice code that is truely and surely >> unused, yes, that's a good thing to do some spring cleaning. >> Unused imports, unused variables, etc. are easy to spot as not needed, >> and can safely be removed. >> Private methods that Groovy doesn't call anywhere could also be removed. >> >> Then, things like public methods that Groovy doesn't use doesn't mean >> this is not used by anyone though. >> >> >> On Sun, Oct 25, 2009 at 15:52, <roshandawrani@...> wrote: >>> Some useless code at some place that I could be sure of removing. >>> >>> I am not in fromt of pc right now but I think in APP#parameter(), it was creating useless VariableExpression objects called leftExpression. That kind of stuff, if I notice somewhere. >>> >>> >>> ------Original Message------ >>> From: Jochen Theodorou >>> To: dev@... >>> ReplyTo: dev@... >>> Subject: Re: [groovy-dev] Unused code removal - confirmation >>> Sent: Oct 25, 2009 7:16 PM >>> >>> roshandawrani@... schrieb: >>>> Oh, my question was more about dead code inside methods, imports, private stuff, etc.. >>>> >>>> I wouln't go around removing anything on any sort of interface. >>> >>> imports and private stuff is ok. What else? >>> >>> bye blackdrag >>> >>> -- >>> Jochen "blackdrag" Theodorou >>> The Groovy Project Tech Lead (http://groovy.codehaus.org) >>> http://blackdragsview.blogspot.com/ >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >>> >>> >>> >>> --------------------------------------------------- >>> Sent from BlackBerry >> >> >> >> -- >> Guillaume Laforge >> Groovy Project Manager >> Head of Groovy Development at SpringSource >> http://www.springsource.com/g2one >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --
Hamlet D'Arcy |
|
|
Re: Unused code removal - confirmationOn Sun, Oct 25, 2009 at 9:44 PM, Alex Tkachman <alex.tkachman@...> wrote: I would suggest to keep even unused private methods. Groovy code base That reduces my interest in cleaning up quite a bit - if even commented code and unused private methods are to be maintained as sources of knowledge. Just my 2c. |
|
|
Re: Unused code removal - confirmation+1
On Sun, Oct 25, 2009 at 17:27, Hamlet D'Arcy <hamletdrc@...> wrote: >> I would suggest to keep even unused private methods. Groovy code base >> is really big and sometimes you can find interesting/useful knowledge >> in unused methods or eeven commented blocks. > > I'm fairly new around here, so I understand when my 2c is ignored... > but here it is: > > this is what version control is for. commented out code and unused > private methods are noise in the signal. If something is > useful/interesting then document it in a test. > > For private methods... my preference is that if you write code that > depends on someone else's privates, then write a test in your code to > assert that those privates exists... then when someone refactors those > privates away (or deletes it b/c it is unused) they will get a > test-time failure from your component instead of a surprise at > runtime. If you don't like the idea of asserting that some other class > has the correct private implementation then the solution is to not > depend on it! > > -- > Hamlet D'Arcy > hamletdrc@... > > > > On Sun, Oct 25, 2009 at 11:14 AM, Alex Tkachman <alex.tkachman@...> wrote: >> I would suggest to keep even unused private methods. Groovy code base >> is really big and sometimes you can find interesting/useful knowledge >> in unused methods or eeven commented blocks. >> >> Just my 2c. >> >> On Sun, Oct 25, 2009 at 4:25 PM, Guillaume Laforge >> <glaforge@...> wrote: >>> In general, if you really notice code that is truely and surely >>> unused, yes, that's a good thing to do some spring cleaning. >>> Unused imports, unused variables, etc. are easy to spot as not needed, >>> and can safely be removed. >>> Private methods that Groovy doesn't call anywhere could also be removed. >>> >>> Then, things like public methods that Groovy doesn't use doesn't mean >>> this is not used by anyone though. >>> >>> >>> On Sun, Oct 25, 2009 at 15:52, <roshandawrani@...> wrote: >>>> Some useless code at some place that I could be sure of removing. >>>> >>>> I am not in fromt of pc right now but I think in APP#parameter(), it was creating useless VariableExpression objects called leftExpression. That kind of stuff, if I notice somewhere. >>>> >>>> >>>> ------Original Message------ >>>> From: Jochen Theodorou >>>> To: dev@... >>>> ReplyTo: dev@... >>>> Subject: Re: [groovy-dev] Unused code removal - confirmation >>>> Sent: Oct 25, 2009 7:16 PM >>>> >>>> roshandawrani@... schrieb: >>>>> Oh, my question was more about dead code inside methods, imports, private stuff, etc.. >>>>> >>>>> I wouln't go around removing anything on any sort of interface. >>>> >>>> imports and private stuff is ok. What else? >>>> >>>> bye blackdrag >>>> >>>> -- >>>> Jochen "blackdrag" Theodorou >>>> The Groovy Project Tech Lead (http://groovy.codehaus.org) >>>> http://blackdragsview.blogspot.com/ >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe from this list, please visit: >>>> >>>> http://xircles.codehaus.org/manage_email >>>> >>>> >>>> >>>> >>>> --------------------------------------------------- >>>> Sent from BlackBerry >>> >>> >>> >>> -- >>> Guillaume Laforge >>> Groovy Project Manager >>> Head of Groovy Development at SpringSource >>> http://www.springsource.com/g2one >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- Guillaume Laforge Groovy Project Manager Head of Groovy Development at SpringSource http://www.springsource.com/g2one --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: Unused code removal - confirmationOf course, I don't suggest to depend on private implementation of
anything. What I am talking about is the fact that in my expirience I several times found very important knowledge from reading unused methods and especially commented blocks of code in groovy core. Please remember that have 6 year of story and many many people were involved in source base. SVN history is helpful only when you know what you are looking for. On Sun, Oct 25, 2009 at 6:27 PM, Hamlet D'Arcy <hamletdrc@...> wrote: >> I would suggest to keep even unused private methods. Groovy code base >> is really big and sometimes you can find interesting/useful knowledge >> in unused methods or eeven commented blocks. > > I'm fairly new around here, so I understand when my 2c is ignored... > but here it is: > > this is what version control is for. commented out code and unused > private methods are noise in the signal. If something is > useful/interesting then document it in a test. > > For private methods... my preference is that if you write code that > depends on someone else's privates, then write a test in your code to > assert that those privates exists... then when someone refactors those > privates away (or deletes it b/c it is unused) they will get a > test-time failure from your component instead of a surprise at > runtime. If you don't like the idea of asserting that some other class > has the correct private implementation then the solution is to not > depend on it! > > -- > Hamlet D'Arcy > hamletdrc@... > > > > On Sun, Oct 25, 2009 at 11:14 AM, Alex Tkachman <alex.tkachman@...> wrote: >> I would suggest to keep even unused private methods. Groovy code base >> is really big and sometimes you can find interesting/useful knowledge >> in unused methods or eeven commented blocks. >> >> Just my 2c. >> >> On Sun, Oct 25, 2009 at 4:25 PM, Guillaume Laforge >> <glaforge@...> wrote: >>> In general, if you really notice code that is truely and surely >>> unused, yes, that's a good thing to do some spring cleaning. >>> Unused imports, unused variables, etc. are easy to spot as not needed, >>> and can safely be removed. >>> Private methods that Groovy doesn't call anywhere could also be removed. >>> >>> Then, things like public methods that Groovy doesn't use doesn't mean >>> this is not used by anyone though. >>> >>> >>> On Sun, Oct 25, 2009 at 15:52, <roshandawrani@...> wrote: >>>> Some useless code at some place that I could be sure of removing. >>>> >>>> I am not in fromt of pc right now but I think in APP#parameter(), it was creating useless VariableExpression objects called leftExpression. That kind of stuff, if I notice somewhere. >>>> >>>> >>>> ------Original Message------ >>>> From: Jochen Theodorou >>>> To: dev@... >>>> ReplyTo: dev@... >>>> Subject: Re: [groovy-dev] Unused code removal - confirmation >>>> Sent: Oct 25, 2009 7:16 PM >>>> >>>> roshandawrani@... schrieb: >>>>> Oh, my question was more about dead code inside methods, imports, private stuff, etc.. >>>>> >>>>> I wouln't go around removing anything on any sort of interface. >>>> >>>> imports and private stuff is ok. What else? >>>> >>>> bye blackdrag >>>> >>>> -- >>>> Jochen "blackdrag" Theodorou >>>> The Groovy Project Tech Lead (http://groovy.codehaus.org) >>>> http://blackdragsview.blogspot.com/ >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe from this list, please visit: >>>> >>>> http://xircles.codehaus.org/manage_email >>>> >>>> >>>> >>>> >>>> --------------------------------------------------- >>>> Sent from BlackBerry >>> >>> >>> >>> -- >>> Guillaume Laforge >>> Groovy Project Manager >>> Head of Groovy Development at SpringSource >>> http://www.springsource.com/g2one >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: Unused code removal - confirmationOn Sun, 2009-10-25 at 18:14 +0200, Alex Tkachman wrote:
> I would suggest to keep even unused private methods. Groovy code base > is really big and sometimes you can find interesting/useful knowledge > in unused methods or eeven commented blocks. That seems counter-productive. The version control system keeps the history. If methods are not called anywhere then they should be removed. Let us make the Groovy codebase as small as possible but no smaller. -- Russel. ============================================================================= Dr Russel Winder Partner xmpp: russel@... Concertant LLP t: +44 20 7585 2200, +44 20 7193 9203 41 Buckmaster Road, f: +44 8700 516 084 voip: sip:russel.winder@... London SW11 1EN, UK m: +44 7770 465 077 skype: russel_winder |
|
|
Re: Unused code removal - confirmation+1 The source code tools these days are very good at browsing history Paul. Russel Winder wrote: > On Sun, 2009-10-25 at 18:14 +0200, Alex Tkachman wrote: >> I would suggest to keep even unused private methods. Groovy code base >> is really big and sometimes you can find interesting/useful knowledge >> in unused methods or eeven commented blocks. > > That seems counter-productive. The version control system keeps the > history. If methods are not called anywhere then they should be > removed. Let us make the Groovy codebase as small as possible but no > smaller. > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
| Free embeddable forum powered by Nabble | Forum Help |