MEDITECH Reports, MEDITECH NPR Reports, NPR Report Writing, NPR Report Writer, NPR Report, MEDITECH Reporting, MEDITECH Report MEDITECH Reports, NPR Reports, NPR Report Writing, NPR Report Writer, MEDITECH NPR

Sunday, January 06, 2008

Commented Out NPR Code

Until reading Neal Ford's 10 Ways to Improve Your Code (www.nealford.com); I hadn't consciously thought about how often NPR Report Writers encounter commented out code in NPR & $T macros.

At times programmers can feel that commenting out code and then leaving it in place is good backup. But ... it makes the MEDITECH NPR code harder to maintain:

- A find and replace in the macro will update the commented code unless you step thru each replacement. That's not fun.
- Commented out code is easy to confuse with production code.
- Backups of the macro OR/AND NPR program preserve the code in its original state.

Neal says it succinctly: "Lots of commented out code is a smell -- get rid of it." Of course he's using the term 'smell' coined by Kent Beck: http://martinfowler.com/bliki/CodeSmell.html.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home