Saturday, May 27, 2006

Continually learning better coding methods

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/continually_learning_better_coding_methods.htm]

Coding requires constant learning. Here are some ideas to help with that:

1 - Be prepared to spend not just time, but mental energy.

2 - Find ways to get input:

  • Other Opinions:
    • Code Reviews - both having people look at your code, and looking at other's code.
    • Read blogs
    • Read articles
    • Read the documentation. If you're using a collection, read the documentation to see how it suggests enumerating through or referencing it's items.
  • Experiment on your own code
  • Reflect back on your code
  • Ask yourself, "does this make sense?". If your own code doesn't make sense to you, it probably won't make sense to others.
  • Make sure that you're not re-inventing the wheel. Look for resuable components.

3 - Make the intent of your code clear so that others can help. If Bob doesn't know what you're trying to do, Bob can't easily help you.

  • Use smaller methods
  • Add helpful comments that explain intent, not just repeat the steps that the code is doing
  • Abstract out context and dependencies such that it's easier for people to understand what you really want.

There's obviously a lot more to say on this, I'll make some follow-up posts.

No comments:

Post a Comment