Questions tagged [coding-style]

Questions regarding code style (i.e. topics like indentation, naming, vertical alignment) and how to teach it

Filter by
Sorted by
Tagged with
30
votes
13answers
2k views

How to teach why indentation is important

I'm trying to teach why indentation is important, but the student doesn't indent. I asked why he doesn't indent, then he answered "That's because it’s a hassle." It's OK to say "you should indent", ...
14
votes
11answers
607 views

How can I show the value of best practices?

As someone who likes to advocate for best practices like correct use of VCS, indentation, sufficient commenting, and testing, I try and integrate them when I teach. But for all of these things, my ...
12
votes
9answers
1k views

How to teach students not to use jump statements

We all know goto is the spawn of satan. To learners though, it seems easy and quick. In simple, short program codes having a goto or two won't turn the code into unreadable spaghetti code. So students ...
8
votes
4answers
372 views

The importance of writing understandable code [duplicate]

Many students do not see the purpose of following conventions (indentation, naming, comments, etc.) which make the code much easier to read and review. Students can learn to follow conventions, but ...
14
votes
3answers
675 views

Do automatic style hints help students to understand the language they're learning?

Do automatic style hints (like those provided by linters) significantly increase the student's understanding of the language they're learning? I am asking because I assist in a course that uses a ...
11
votes
7answers
518 views

How can I discourage poor design while using automatic grading of submissions?

Automatic grading is great for saving time on marking programming tasks, so there's more time to focus on actual teaching, but I've noticed a few flaws. Since work is essentially marked based on ...