Thursday, November 21, 2013

Coding Woes, and Comment Etiquette

Comments, some may argue that they're equally as important as the code itself. When I first learned to code it was mainly little projects done only for myself. I would automate little things or solve problems for Project Euler. Comments were for myself, and the simplicity of the code usually meant that I didn't do much commenting. Ah, that habit came back to bite me today.
Some comments on my A2 submission.
AH! A whole 3 points gone because of sparse commenting on my part. My code worked fine though! Isn't that what matters? No, comments are important, because in a professional or even an academic environment, the code you write isn't just for you. It's for you as well as the people that need to work on it as well, either to adjust it or maintain it. It seems like a small nuisance at first, though it's a habit that is an absolute must for a competent programmer. Success requires communication, something that fast uncommented code doesn't always do very well. So I'll try to stick to the habit of doing so, hopefully so will everyone else, and we can all enjoy good communication in the future.

2 comments:

  1. I definitely agree - commenting is very important both for yourself and for others reading your code, but its also important to write code that doesn't necessarily need comments. Clean code should speak for itself.

    ReplyDelete
    Replies
    1. Lesson of the story, communicate ideas well via comments and clean code.

      Delete