Re: Ambiguous Refactoring Solution

Richard <[email protected]>
Newsgroups gmane.comp.programming.refactoring
Organization multi-cellular, biological
Message-ID <[email protected]>
In article <[email protected]>,
    Carfield Yim <[email protected]>  writes:

> Sometime we may like to remove variable that we think we don't use anymore,=
>  like
> 
> int dog =3D createDog();
> 
> however in method createDog(), it may do more than just return a dog
> and remove that line cause somthing else fail.
> 
> With unit test we can prevent problem like that, of course if you
> don't you will make mistake then it is fine

...and without a unit test, you would do things like inspect createDog
for side-effects that must occur, or you wouldn't remove the whole
statement, just the variable declaration because side effects may be
possible.

Or, holy shit batman!, you could test it manually.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/refactoring/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/refactoring/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.