refactoringhttp://www.turnkeylinux.org/taxonomy/term/122/0
enMy code refactoring algorithmhttp://www.turnkeylinux.org/blog/refactoring-algorithm
<p>
You&#39;re looking at a block of Python code. It&#39;s not immediately obvious what it does. It&#39;s sort of a mess and you realize it needs to be refactored. But how? What mental algorithm do you use?</p>
<p>
<!--break-->
Here&#39;s a trick I just figured out how to put into words. You first add comments to your code to make it easier to explain what it&#39;s doing in each part. Then you restructure the code until those comments are no longer necessary, using the comments as a guide to creating high level constructs that not only tuck complexity neatly away, they also explain the purpose of the surface.</p>
<p>
What tricks do you use?&nbsp;</p>http://www.turnkeylinux.org/blog/refactoring-algorithm#commentsdevelopmentinsightpythonrefactoringMon, 02 May 2011 06:26:11 +0000Liraz Siri1415 at http://www.turnkeylinux.org