<p>Let me answer from the perspective of a seasoned software developer.</p>
<blockquote>
<p>During the course we have frequently commented on the importance of
code quality, not merely the solution being functional.</p>
</blockquote>
<p>I suppose you made clear that code quality becomes relevant for the grading, hopefully indicating how much influence that aspect has.</p>
<p>Using features that haven't been covered in your course is not a bad thing in itself. Generally, it shows initiative on the side of the student. But with freedom comes responsibility. So, using &quot;outside-the-course&quot; features can earn bonus as well as malus points.</p>
<p>You mention two different aspects:</p>
<ul>
<li><code>goto</code> statements. As more or less every source about <code>goto</code> statements makes it clear that they should be avoided as much as possible, a student using them should have known that. That's worth a big malus.</li>
<li><code>#region</code> / <code>#endregion</code> blocks. The intentions are good, to help some editors with structuring the code. But an internet search should have revealed that #region is not a standard C++ construct, making the code dependant on some specific compiler. I'd just comment on the problems, and not subtract any points.</li>
</ul>

CC BY-SA 4.0
2022-07-05T19:31:13.693Z
Yes, the students were given quite detailed instructions what and how things will be graded. I also really like the part when you say "*But with freedom comes responsibility. So, using "outside-the-course" features can earn bonus as well as malus points.*". This is something that I will be including in the main slides of the course :)
Fureeish
CC BY-SA 4.0
2022-07-06T12:36:03.993Z
@NOTCSEducator Which conversation??? I don't see any correlation between the question and the chat you linked to.
Ralf Kleberhoff
CC BY-SA 4.0
2022-07-06T14:49:40.730Z
@RalfKleberhoff You're not the only one https://cseducators.meta.stackexchange.com/questions/505/rogue-moving-to-chat
Rushi
CC BY-SA 4.0
2022-07-05T09:00:23.787Z
2022-07-05T09:00:23.787Z
Ralf Kleberhoff
<p>My recommendation is just a bit harsher than that softy, Buffy (all of whose advice is very good, by the way).</p>
<p>I will often deduct a few points (not much) to create just enough sting to get students to pay attention to how to improve.  How many points are needed depends a lot on the population of students you've got.  I've taught in a lot of different environments, and I've found that 1 percentage point can be enough for some kids, while 3 or 5 is more liable to catch the attention of others.</p>
<p>If the mistake is egregious enough, I might even go as high as 10, but, again, the purpose is to catch students attention, not to punish, so it would have to be both a very small assignment (with little impact on their larger grade) and a less grade-conscious population for me to go so high.</p>
<p>I would then put a fairly lengthy note explaining the bad practice, and I'd make sure that the note is prominently referenced next to their grade (e.g. <em><strong>see important note at the end</strong></em> or some such.)</p>
<p>An alternative approach is to make a far larger deduction, but write a note saying to see you for a chance to earn the points back.  Whether or not something like this is appropriate depends on your institution and circumstances, so I can't comment.  I will say that it can really help students learn, and it's an approach that they often appreciate because it both helps them to grow and is pretty non-punitive.</p>

CC BY-SA 4.0
2022-07-05T11:08:20.533Z
Yes, if regrading is possible then you can use initial marks to send a message.
Buffy
CC BY-SA 4.0
2022-07-05T19:32:36.313Z
I am heavily considering regrading. It takes *a lot* of time though. We are short-staffed and usually each of the tutors is responsible for ~200 students each semester.
Fureeish
CC BY-SA 4.0
2022-07-05T02:41:02.597Z
2022-07-05T11:24:45.820Z
2022-07-05T11:24:45.820Z
Ben I.
<p>My recommendation is that, for purposes of grading, that you take no action at all. You haven't indicated that you were clear with the students that such &quot;outside the box&quot; tools were not to be used, so it would be changing the rules after the game is played to deduct points now.</p>
<p>The grading rubric used by graders needs to be clear and specific. It needs to be developed along with the exercise prior to giving he assignment, not after it has been completed by students. It doesn't need to be revealed to students, but the instruction given to students needs to be completely consistent with it. If this was not anticipated, then you are ethically a bit stuck. Treat it as a learning exercise for the next time you give a programming exercise. If this is important for grading then make it equally important for instruction.</p>
<p>However, there is the possibility that the code was found, not written by the students, so you might need to explore that.</p>
<p>It is also possible that a few students in your huge class had previous knowledge and habits about coding that they fell back on. Some students in an &quot;elementary&quot; course know quite a lot about coding, though perhaps not very sophisticated. Someone who had done assembly programming in the past might naturally want to use goto in spite of your admonitions.</p>
<p>You might, however, want to have a conversation with the students to see &quot;why&quot; they coded as they did. It might give you some insight about how things occurred.</p>

CC BY-SA 4.0
2022-07-05T19:29:13.457Z
Students had been given a very detailed rubric containing specific criteria by which they were graded. The rubric consisted of a record that spelled "Code quality" paired with some examples. It's not about whether they were expecting to be graded for code quality. It's about them using tools that are pretty much objectively low quality. I believe that if they took their time to reserach those tools they would've come to the conclusion that they shouldn't be using them. I held lengthy conversations with the students and ultimately it boiled down to them not researching the topic enough.
Fureeish
CC BY-SA 4.0
2022-07-06T05:06:53.133Z
Buffy's newly added para is my point also @Fureeish. You say "frowned upon".Did you frown unambiguously enough? Maybe your frown looked like a smile? Your two egs are quite disparate. "Gotos are bad" is a widely held (and baseless) belief stemming from misunderstanding what Dijkstra was saying. I could write a counter-dissertation. Would it help?? I suspect "Gotos are bad" is non negotiable in your framing. Dijkstra didn't like goto. Knuth did (does). Dijkstra won. Did CS win from this? Region OTOH seems to be a non C++ feature. How does the question of using it arise? Methinks 2 questions...
Rushi
CC BY-SA 4.0
2022-07-16T19:36:21.223Z
Although I fully agree, this reminds me of the first step in [Teaching is a slow process of becoming everything you hate](https://dynomight.net/teaching/).
ggorlen
CC BY-SA 4.0
2022-07-04T23:34:20.920Z
2022-07-05T19:01:13.417Z
2022-07-05T19:01:13.417Z
Buffy
<p>This semester my students had to submit a project. Small, yet rich in functionality console application written in C++. They had 8 weeks during which I was always available for consultations. In addition to that, I have scheduled some extra time for students to consult their ideas, implementation and ponder over some of their problems.</p>
<p>Majority of the submitted projects were of a quite high quality. However, some of them used tools that were neither covered nor are particularly advised by the external sources. On the contrary, actually.</p>
<p>For example, one of the students (out of ~1000) used a bunch of <code>goto</code>s. We are teaching Modern C++ and we have never covered <code>goto</code>s during the laboratories. They were briefly <em>mentioned</em> during lectures, but it was more of a &quot;we don't do that here&quot; comment.</p>
<p>Another submitted project was covered with <code>#region</code>s. As far as I am aware, even in C# it's no longer a practice.</p>
<p>During the course we have frequently commented on the importance of code quality, not merely the solution being functional. During the defense of the project I took my time explaining why such approaches are undesirable, but I was not convinced about the course of action regarding the grade. A part of the grade was being dedicated to code quality and usage of proper tools. The students knew it the whole time. While I <em>could</em> see some negative points being assigned for using <code>goto</code> since it was mentioned in the lectures that students should not use that unless there really is no better way of achieving the desired goal, I am really unsure what to do about <code>#region</code>s or other obscure approaches that do not apply to C++.</p>
<p>Are there preferred way to approach problems like this?</p>

CC BY-SA 4.0
2022-07-05T07:01:40.563Z
Is `#region`  a thing in C++? Doesn't seem so... https://social.msdn.microsoft.com/Forums/en-US/408159fd-563b-478c-9880-b47658f9e085/what-is-the-equivalent-of-c-region-in-c?forum=vcgeneral
Rushi
CC BY-SA 4.0
2022-07-06T14:47:22.067Z
You will go nuts unless you make a uniform decision on what compiler to use.  The #region is not a part of standard C/C++.   It's an added preprocessor directive defined in some proprietary .h file.
ncmathsadist
CC BY-SA 4.0
2022-07-06T20:10:31.143Z
@ncmathsadist replace `#region` with `#define region_[some_name]` and suddently it's legal everywhere, but still a frowned upon practice. You can't pinpoint everything. This question is focused on finding ways to deal with the unexpected, because the unexpected will happen. No matter how hard we try to restrain students.
Fureeish
CC BY-SA 4.0
2022-07-06T22:51:13.637Z
This is too vague about what was told to the students for us to give a reasonable non-generic response. Eg "code quality" means nothing in particular, what were they told that their code had to be like & not be like to be of good & bad quality? The deliverable is not just code with certain functionality but with certain properties including functionality, and you if you're not getting what you wanted did you say what you wanted? PS The way you avoid this problem is by project management. Eg milestones with partial functionality on which you give feedback.
philipxy
CC BY-SA 4.0
2022-07-07T10:42:56.030Z
@philipxy I would aim for this question to be quite generic, thus I refrained myself from providing any particular examples. Everyone has different ways of conveying information. All in all, you can't really taech code quality. Students need examples, students need to solve problems and students need to fall into traps in order to learn from their mistakes. This was one of the goals of the course. Nonetheless I believe that your PS is a really good advise. Worthy to be an answer itself.
Fureeish
CC BY-SA 4.0
2022-07-07T14:03:33.003Z
_"As far as I am aware, even in C# it's no longer a practice."_ As a C# developer, it's not a matter of having been decided to be in/out of practice. Regions _can_ be used sensibly, but they can also be used to hide monolithic code. It's this reason why regions are sometimes discouraged, when in actuality the issue is not the usage of the regions themselves but rather if/when they are used to hide bad coding practices. I wouldn't discourage the use of regions so long as the uncollapsed code itself does not pose a monolithic bad practice.
Flater
CC BY-SA 4.0
2022-07-16T10:25:52.550Z
The question would be whether the untaught use of the `goto`s and `#region`s were positively detrimental compared to an alternative that had been taught. I can't imagine that the '#regions' would be detrimental in themselves, just being one of the facilities available for code organisation. The use of the 'gotos' suggests they haven't been taught the tenets of block-structured code (and the importance of structured jumps, and the retention of 'goto' as an exceptional facility for unusual algorithms), and you can barely complain about things that haven't been taught yet.
Steve
CC BY-SA 4.0
2022-07-16T12:19:44.203Z
@Steve in this particular case, the students were taught Java first in the previous semester. Java doesn't have `goto`s per se. Only labeled loops so you can `break` from multiple nested scopes. I believe that most of what you're saying somewhat ignores what I wrote in the 3rd paragraph of my question.
Fureeish
CC BY-SA 4.0
2022-07-16T15:18:19.300Z
@Fureeish, it's precisely the 3rd paragraph that made me think you haven't taught the basics of structured programming explicitly - because I can't imagine anyone could talk about structured programming and its advantages without talking about what is unstructured, and therefore talking about goto.
Steve
CC BY-SA 4.0
2022-07-16T19:28:36.013Z
If the tools you gave them are radically different from the ones they used, have you eliminated the possibility of third-party assistance? (a bit more bluntly: plagiarism or for-hire coding). 1000 students is a _huge_ number. More details about how you enforce an honor code, or even manage to look at 1000 assignments to check code quality, could be useful. `goto` is still used in C error handling--CPython/Modules has about 5300 occurrences, although not C++ as far as I know. More details seem necessary here, although it seems like you can't penalize anything not in the rubric.
ggorlen
<project><grading><advising>
How to approach students who submit their work which consists of frowned upon tools?
# How to approach students who submit their work which consists of frowned upon tools?

(Asked by: username_0 on 2022-07-04)

This semester my students had to submit a project. Small, yet rich in functionality console application written in C++. They had 8 weeks during which I was always available for consultations. In addition to that, I have scheduled some extra time for students to consult their ideas, implementation and ponder over some of their problems.

Majority of the submitted projects were of a quite high quality. However, some of them used tools that were neither covered nor are particularly advised by the external sources. On the contrary, actually.

For example, one of the students (out of ~1000) used a bunch of `goto`s. We are teaching Modern C++ and we have never covered `goto`s during the laboratories. They were briefly *mentioned* during lectures, but it was more of a "we don't do that here" comment.

Another submitted project was covered with `#region`s. As far as I am aware, even in C# it's no longer a practice.

During the course we have frequently commented on the importance of code quality, not merely the solution being functional. During the defense of the project I took my time explaining why such approaches are undesirable, but I was not convinced about the course of action regarding the grade. A part of the grade was being dedicated to code quality and usage of proper tools. The students knew it the whole time. While I *could* see some negative points being assigned for using `goto` since it was mentioned in the lectures that students should not use that unless there really is no better way of achieving the desired goal, I am really unsure what to do about `#region`s or other obscure approaches that do not apply to C++.

Are there preferred way to approach problems like this?

**Tags:** project, grading, advising

> **Comments:**
> **username_1**: Is `#region`  a thing in C++? Doesn't seem so... https://social.msdn.microsoft.com/Forums/en-US/408159fd-563b-478c-9880-b47658f9e085/what-is-the-equivalent-of-c-region-in-c?forum=vcgeneral  
> **username_2**: You will go nuts unless you make a uniform decision on what compiler to use.  The #region is not a part of standard C/C++.   It's an added preprocessor directive defined in some proprietary .h file.  
> **username_0**: @username_2 replace `#region` with `#define region_[some_name]` and suddently it's legal everywhere, but still a frowned upon practice. You can't pinpoint everything. This question is focused on finding ways to deal with the unexpected, because the unexpected will happen. No matter how hard we try to restrain students.  
> **username_3**: This is too vague about what was told to the students for us to give a reasonable non-generic response. Eg "code quality" means nothing in particular, what were they told that their code had to be like & not be like to be of good & bad quality? The deliverable is not just code with certain functionality but with certain properties including functionality, and you if you're not getting what you wanted did you say what you wanted? PS The way you avoid this problem is by project management. Eg milestones with partial functionality on which you give feedback.  
> **username_0**: @username_3 I would aim for this question to be quite generic, thus I refrained myself from providing any particular examples. Everyone has different ways of conveying information. All in all, you can't really taech code quality. Students need examples, students need to solve problems and students need to fall into traps in order to learn from their mistakes. This was one of the goals of the course. Nonetheless I believe that your PS is a really good advise. Worthy to be an answer itself.  
> **username_4**: _"As far as I am aware, even in C# it's no longer a practice."_ As a C# developer, it's not a matter of having been decided to be in/out of practice. Regions _can_ be used sensibly, but they can also be used to hide monolithic code. It's this reason why regions are sometimes discouraged, when in actuality the issue is not the usage of the regions themselves but rather if/when they are used to hide bad coding practices. I wouldn't discourage the use of regions so long as the uncollapsed code itself does not pose a monolithic bad practice.  
> **username_5**: The question would be whether the untaught use of the `goto`s and `#region`s were positively detrimental compared to an alternative that had been taught. I can't imagine that the '#regions' would be detrimental in themselves, just being one of the facilities available for code organisation. The use of the 'gotos' suggests they haven't been taught the tenets of block-structured code (and the importance of structured jumps, and the retention of 'goto' as an exceptional facility for unusual algorithms), and you can barely complain about things that haven't been taught yet.  
> **username_0**: @username_5 in this particular case, the students were taught Java first in the previous semester. Java doesn't have `goto`s per se. Only labeled loops so you can `break` from multiple nested scopes. I believe that most of what you're saying somewhat ignores what I wrote in the 3rd paragraph of my question.  
> **username_5**: @username_0, it's precisely the 3rd paragraph that made me think you haven't taught the basics of structured programming explicitly - because I can't imagine anyone could talk about structured programming and its advantages without talking about what is unstructured, and therefore talking about goto.  
> **username_6**: If the tools you gave them are radically different from the ones they used, have you eliminated the possibility of third-party assistance? (a bit more bluntly: plagiarism or for-hire coding). 1000 students is a _huge_ number. More details about how you enforce an honor code, or even manage to look at 1000 assignments to check code quality, could be useful. `goto` is still used in C error handling--CPython/Modules has about 5300 occurrences, although not C++ as far as I know. More details seem necessary here, although it seems like you can't penalize anything not in the rubric.  

---

## 3 answers

### Answer by username_9 on 2022-07-04. Score: 4

My recommendation is that, for purposes of grading, that you take no action at all. You haven't indicated that you were clear with the students that such "outside the box" tools were not to be used, so it would be changing the rules after the game is played to deduct points now.

The grading rubric used by graders needs to be clear and specific. It needs to be developed along with the exercise prior to giving he assignment, not after it has been completed by students. It doesn't need to be revealed to students, but the instruction given to students needs to be completely consistent with it. If this was not anticipated, then you are ethically a bit stuck. Treat it as a learning exercise for the next time you give a programming exercise. If this is important for grading then make it equally important for instruction.

However, there is the possibility that the code was found, not written by the students, so you might need to explore that.

It is also possible that a few students in your huge class had previous knowledge and habits about coding that they fell back on. Some students in an "elementary" course know quite a lot about coding, though perhaps not very sophisticated. Someone who had done assembly programming in the past might naturally want to use goto in spite of your admonitions.

You might, however, want to have a conversation with the students to see "why" they coded as they did. It might give you some insight about how things occurred.

> **Comments:**
> **username_0**: Students had been given a very detailed rubric containing specific criteria by which they were graded. The rubric consisted of a record that spelled "Code quality" paired with some examples. It's not about whether they were expecting to be graded for code quality. It's about them using tools that are pretty much objectively low quality. I believe that if they took their time to reserach those tools they would've come to the conclusion that they shouldn't be using them. I held lengthy conversations with the students and ultimately it boiled down to them not researching the topic enough.  
> **username_1**: username_9's newly added para is my point also @username_0. You say "frowned upon".Did you frown unambiguously enough? Maybe your frown looked like a smile? Your two egs are quite disparate. "Gotos are bad" is a widely held (and baseless) belief stemming from misunderstanding what Dijkstra was saying. I could write a counter-dissertation. Would it help?? I suspect "Gotos are bad" is non negotiable in your framing. Dijkstra didn't like goto. Knuth did (does). Dijkstra won. Did CS win from this? Region OTOH seems to be a non C++ feature. How does the question of using it arise? Methinks 2 questions...  
> **username_6**: Although I fully agree, this reminds me of the first step in [Teaching is a slow process of becoming everything you hate](https://dynomight.net/teaching/).  

---

### Answer by username_8 on 2022-07-05. Score: 1

My recommendation is just a bit harsher than that softy, username_9 (all of whose advice is very good, by the way).

I will often deduct a few points (not much) to create just enough sting to get students to pay attention to how to improve. How many points are needed depends a lot on the population of students you've got. I've taught in a lot of different environments, and I've found that 1 percentage point can be enough for some kids, while 3 or 5 is more liable to catch the attention of others.

If the mistake is egregious enough, I might even go as high as 10, but, again, the purpose is to catch students attention, not to punish, so it would have to be both a very small assignment (with little impact on their larger grade) and a less grade-conscious population for me to go so high.

I would then put a fairly lengthy note explaining the bad practice, and I'd make sure that the note is prominently referenced next to their grade (e.g. ***see important note at the end*** or some such.)

An alternative approach is to make a far larger deduction, but write a note saying to see you for a chance to earn the points back. Whether or not something like this is appropriate depends on your institution and circumstances, so I can't comment. I will say that it can really help students learn, and it's an approach that they often appreciate because it both helps them to grow and is pretty non-punitive.

> **Comments:**
> **username_9**: Yes, if regrading is possible then you can use initial marks to send a message.  
> **username_0**: I am heavily considering regrading. It takes *a lot* of time though. We are short-staffed and usually each of the tutors is responsible for ~200 students each semester.  

---

### Answer by username_7 on 2022-07-05. Score: 0

Let me answer from the perspective of a seasoned software developer.

> During the course we have frequently commented on the importance of
> code quality, not merely the solution being functional.

I suppose you made clear that code quality becomes relevant for the grading, hopefully indicating how much influence that aspect has.

Using features that haven't been covered in your course is not a bad thing in itself. Generally, it shows initiative on the side of the student. But with freedom comes responsibility. So, using "outside-the-course" features can earn bonus as well as malus points.

You mention two different aspects:

* `goto` statements. As more or less every source about `goto` statements makes it clear that they should be avoided as much as possible, a student using them should have known that. That's worth a big malus.
* `#region` / `#endregion` blocks. The intentions are good, to help some editors with structuring the code. But an internet search should have revealed that #region is not a standard C++ construct, making the code dependant on some specific compiler. I'd just comment on the problems, and not subtract any points.

> **Comments:**
> **username_0**: Yes, the students were given quite detailed instructions what and how things will be graded. I also really like the part when you say "*But with freedom comes responsibility. So, using "outside-the-course" features can earn bonus as well as malus points.*". This is something that I will be including in the main slides of the course :)  
> **username_7**: @NOTCSEducator Which conversation??? I don't see any correlation between the question and the chat you linked to.  
> **username_1**: @RalfKleberhoff You're not the only one https://cseducators.meta.stackexchange.com/questions/505/rogue-moving-to-chat  

---

