Python code-bloat tool-- warning n00b stuff...

David Stanek dstanek at dstanek.com
Mon May 18 17:46:21 EDT 2009


On Mon, May 18, 2009 at 12:45 PM, david wright
>
> I would suggest looking into TDD (test driven development).
>
> This technique would be a good fit to eliminate you feeling of code bloat, in TDD you only write the necessary amount
> of code to make your test pass, hence you never write code that is not going to be utilized.
>
> It takes a little while to get used to this technique ( also, it can be much more difficult to apply in some situations) but it's well worth the effort. :). You'll have no trouble finding tons of resources for this topic.

TDD does help cut down on code bloat, but not because you are only
coding what will actually be used. Rather because of rule #3:
 1. Red - write just enough test code to make a test fail
 2. Green - write just enough production code to make the test pass
 3. Refactor - mercilessly reduce duplication
 4. Repeat

-- 
David
blog: http://www.traceback.org
twitter: http://twitter.com/dstanek



More information about the Python-list mailing list