Tuesday, November 11, 2003

Dirty Code is Evil

Keeping the Code Clean at InformIT.com

Keeping your code clean is just as important as getting it to work. Clean code allows you to extend and maintain your modules, whereas dirty code ties you in knots. I can't stress this enough: Software professionals don't leave their code in an unclean state. They don't tolerate sloppiness, wanton duplication, or messiness. Professionals take pride not only in getting their code to work, but also in keeping it simple, small, and easy to read.

Good basic article on TDD. I wouldn't have chosen to make the FooToXML code a static class. Why not just place that functionality right into the Foo class? The way Martin has it, it reminds me too much of EJBs (not very object oriented). I like to place the methods that operate on my data in the class that holds the data. But when Martin speaks, you gotta listen. Good cooking analogy at the end.
Post a Comment

Disclaimer

I'm probably required to say that the views expressed in this blog are my own, and do not necessarily reflect those of my employer. Also, except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the BSD License.