Comment Simple steps that should always be followed (Score 1) 1021
I thought this was a pretty interesting topic seeing as I was up until the wee hours of the morning last night doing some major programming for one of my final assignments.
This was a group assignment so we have essentially 3 guys, 2 who are programmers working on the same project. I do a bulk of the programming so most of the code there is mine, but the other programmer has a style of coding completely opposite of mine.
We're coding this thing in J# which we all taught ourselves. We're all hug java fans so that's why we chose this language.
Our code has basically no commenting. It did at first in the early stages of development, but as things took off, the code doubled and tripled and soon there was so much. I think the main reason for this is because many of the forms used follow the same logic, all have similar functions (but not similar enough to design a class to handle all the operations). Anyway, since I was project lead, and I did most of the bulk code, I knew what was going on at any point in time - since it was my logic. The other programmers code which handled different operations was not so readable - but he probably thinks the same as mine since I specialized in the part of the application which handled interacting with the database.
The following are things that I think greatly aid the readability of code between programmers:
1) Good Variable Names - descriptive, but not a novel, short, but not an abbreviation of an abbreviation you've made yourself.
2) Follow flow and use proper indenting. Methods, functions, subroutines, all that should be indented properly. So many times I rely on the indenting to understand the flow of the application.
3) Comment difficult procedures. If something has caused you a lot of grief to program, document what the hell it is that you came up with. A programmer trying to interpret your code is going to be just as confused as you were when you encountered the problem. If you document how you solved that problem, or why you chose to do what you did your teammates are going to love you.
I guess there can be excessive commenting and what's required. With good variable names, proper indentation, and comments guiding the readers of your code through the more difficult areas you'll be fine. I mean hell, if they don't know a thing aabout programming to begin with, why would they be reading? You should assume the reader has at least a minimal understanding of programming logic.