Quote:
Originally Posted by Alan Anderson
Then who decides what "good style" is? How do you determine "good technique" from a finished program?
In c, which would you award points for: putting curly braces on the same line as the if statement, or putting them in the same column? Do you penalize a test for equality to one because it's redundant, or do you reward it because it's clearly readable? Do you want to promote block comments or line comments? What do you think of Hungarian Notation? How would you grade Duff's Device?
I just don't think it's a good idea to try to judge style. I don't think it's possible to do so unless there's a single person doing the judging, and I think there is too much subjectivity about what makes style "good" to make it a positive experience for those involved.
|
we don't necessarily have to make it an award or judge it. We just have to find a successfull way to make good style appealling. the way we do that is where we need to think.
take for example my professor's take on what "good" style is:
Quote:
|
Originally Posted by Dr. Dunn
From program assignement requirements:
"these items (2 & 3) should be included in your program (as comments).
2) the programmer name, class, date developed and date complete. also, include coding comments, properly indent the code, and have all procedures (functions/methods) separated from other procedures (functions methods) by at least one blank line (internal documentation/style). --> 20%
3) A statement of the problem description. this may include additional information for problem clarification. the expected inputs. to the problem. the statements concerning the pysical souce of the data and examples should be included here. the expected outputs or result of theproblem solution which should include example outputs based on example inputs but should be explicitly noted as test data --> 30 %
|
The rest of the sheet just refers to the report we have to make
while some of the requirements above are not applicable to FIRST, I think they get the point across.
the applicable requirements above are really all we need to judge on. my teacher does not care whether we put our brackets in line-end style or next line style and most of the other criteria we could come up with can be solved just by following these simple ones.
the only other applicable thing we do that I did not include in the quote is that we have to put an algorithm in quotes in our code. (an algorithm is a psuedocode or flowchart that describes the codes process and function).
besides that, we don't need to make the criteria complex. all we need to judge on is the main style errors that cause the most problems (variable names, indentation, spacing, comments).
P.S.
If you want to see the rest of the sheet, just let me know.
but overall, we do not necessarily have to make it an award. There just has to be a successfull and appealling reason for the programmers to want to practice good style.