Thursday, February 02, 2006

Coding practices I get stressed about

- duplicate code
- eating exceptions


At 2/14/2006 5:13 p.m., Blogger Jonathan said...

- convoluted logic

At 2/22/2006 12:47 p.m., Blogger Jonathan said...

- untested code

At 3/08/2006 10:43 a.m., Blogger Jonathan said...

- hiding error details, so people have no way of sending you a stack trace when a problem occurs

- extra logic. A lot of checks for error conditions are not necessary because those errors are not supposed to happen (and if they do happen, we want to know the details about them rather than hiding them behind a generic error message).

Code should be as terse as a mathematical formula. Of course, since this is the real world, a few inelegant hacks and checks are fine as long as they are accompanied by an explanatory comment. But start with a foundation of terse, elegant code before adding the ugly bits (and those placed with laserlike precision).


Post a Comment

<< Home