[ 17 November 2005 ]

Code Commenting

There was an interesting thread on /. this morning regarding coding practices. There was a lot of decent advice given, some stupid comments (this is Slashdot we're talking about) but most importantly, it got me thinking about my coding practices. After some long hard thought (totaling about twelve seconds) I came up with my guiding principals regarding my coding 'style'
  1. Descriptive variable names
  2. Camel case
  3. Comment only the 'why' of complicated sections.
My thoughts on commenting are based on real-world experience. If you can't read the language I'm writing in (either C#, JavaScript, or CFML) then no amount of comments are going to make things clear to you. Code is a language. Be fluent, or get out of it. I have been completely exaperated by folks coming behind me and saying things like, "You commented why you are doing this, but you didn't say how you were accomplishing it..."

My response to queries like that has always been the same. "Yes, I did. Just read it."

And that is my $.02. This is my blog, after all.

0 Comments:

Post a Comment

<< Home