cowboy me, 2.0: jose nazario beauty and the street

comments in code

another stencil in an alleyway in ann arbor. sadly, painted over soon after this was taken.

an interesting essay brought to light by slashdot, Comments Are More Important Than Code, brings up a few points. some tips if you're thinking about your code or your coworkers.

use an automatic documentation system like doxygen (or any of the myraid of related tools) to generate some docs without any extra effort on your own. see how badly they suck, now go tune your code to suit your doc's needs. a cheap and easy way to measure your code structure and comments.

use a consistent naming scheme. one thing i stole from dug song is to name my "private" (not to be exported) interfaces by prepending them with an underscore. the compiler doesn't treat it specially, but visually you do. makes a lot of sense.

and finally read code, it's not just a write-only experience. writing a lot of code will help, but actually go and just read some code. you'll see some good and some bad code, but spend some time every day checking out other projects and their code. you'll be glad you did.



| archives

Last modified: Wednesday, Apr 27, 2005 @ 08:43am
Weblog Commenting and Trackback by

Your Ad Here

copyright © 2002-2015 jose nazario, all rights reserved.