5
$\begingroup$

From an instructor perspective (Middle School or High School), Is there a method, or a set of guidelines, for grading early coders' projects that could enhance good coding practices as the students advance further into computer science?

Are any "online practice sites" or "auto-graders" worthy enough to look at for daily or lab project/practice?

$\endgroup$
2
  • 3
    $\begingroup$ Welcome to CSEducators.SE! Thanks for your first question. It seems like you are asking two questions here: one on guidelines and one on practice sites. Is that correct? If so, I'd suggest splitting this into two separate questions. Also, can you specify the relevant language(s)? Good coding practices and grading guidelines will most likely vary depending on the language. $\endgroup$
    – Peter
    Jun 7, 2017 at 16:19
  • $\begingroup$ This question would be improved if the title was more distinct from the other ta:best-practice question (which I don't feel is really related, so I won't link here). I think you're asking more about implementing style checking flows rather than 'selling' the concept of best practice. $\endgroup$ Jun 8, 2017 at 9:26

3 Answers 3

5
$\begingroup$

We use the Eclipse plugin Checkstyle. The plugin is configured with a set of rules (defaults styles are available with the plugin), and then generates a set of warnings for any violations of these rules. Toward the end of our CS1, we introduce students to the tool (the students have been taught our expectations throughout the semester). After they are introduced to the plugin, all of their remaining projects will lose points if they have Checkstyle warnings in their project submission (e.g., one points off per warning to a max of 10 points). Checkstyle gives them immediate feedback as they are writing code (in the same way compiler warnings/errors are presented in Eclipse) with the loss of points as incentive to not just ignore the warnings. This practice is continued in CS2 from the start of the semester.

This experience is at University level, but should be applicable to anyone using Eclipse in an AP CS A or similar course.

$\endgroup$
2
$\begingroup$

I use an online auto grader for probably 95% of the assignments my students - high school, AP-A - do in class. Before that I would run unit tests on the submitted code and then leave comments. But I've found that the immediate feedback, especially on smaller assignments, helps them learn to solve the problems on their own. Plus, it saves me from having to look at 10 or 15 versions of their code. I typically only look at the one that works.

For style, I'll leave comments on completed assignments when it's bad.

What I've found really helps though is to not help them with questions if the code is a mess. Especially early in the year "clean up your code, and I'll come back" is my stock answer if it's messy. After a couple times they'll clean it up on their own, and usually they'll figure out the problem on their own.

I don't have specific rules other than it's easy to follow. Coding styles tend to be pretty subjective - braces on the same line, or the next line; should the brace be indented; should an else be on the same line as the brace closing the if. I tell them it's like handwriting. If it's neat, it's easier to read.

I will show examples, both good and bad, anonymously on the board. Some kids don't understand what a good snippet of code looks like. But almost everyone can agree on messy code.

$\endgroup$
1
$\begingroup$

In my high school class, decades ago, all programs had to be submitted to a fellow student of choice for a "peer review" and critique before being submitted to the teacher. People took these reviewing tasks seriously, because the score for the review was the same as the score for the underlying program itself. That tended to improve the coding practices of both parties by aligning their interests.

In the first semester, the highest grade was earned by the person with most reviews. That was true even though he submitted relatively few programs himself. Instead, he had become the "go to" person for reviewing others' work, and his "best practices" permeated the rest of the class.

$\endgroup$
3
  • $\begingroup$ "the score for the review was the same as the score for the underlying program itself" - very interesting idea. How can you convince someone else to look at your work when there is such a threatening grading policy? $\endgroup$
    – Ben I.
    Jun 11, 2017 at 19:14
  • $\begingroup$ @Ben I.: First of all, the scores were additive, not averaged. So you could get the same cumulative score, 80, for 10 programs or reviews with an average score of 8, or 8 items with all 10s. Even so, there was a time constraint. So this one go-to guy had his pick of the best programmers, etc. He was not the best programmer but the best editor. Essentially the class sorted itself out, with programmers and reviewers finding counterparts of roughly equal caliber, barring "interpersonal" factors (e.g. the three girls in the class mostly reviewed each other's work). $\endgroup$
    – Tom Au
    Jun 11, 2017 at 19:20
  • $\begingroup$ If I get time, I'm going to work up a question about this idea... students reviewing students. Or someone else can ask. That would be a very interesting discussion indeed! $\endgroup$
    – Ben I.
    Jun 11, 2017 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.