Skip to main content

Questions tagged [coding-style]

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

2 votes
1 answer
62 views

Sometime in the last few months here on SE I saw a link to a major language style guide that walked through the thought process of refining very short comments in code. I think it took an example ...
Daniel R. Collins's user avatar
1 vote
1 answer
254 views

The term hacker didn't originate at MIT rail road club, it's as ancient as press, or mass publications, and the same argument still exists. How do we tie the common definition and word use by ...
Light Bringer's user avatar
1 vote
3 answers
138 views

While I'm sure that the comp-sci 101 mistake of having a triple nested loop with two recursive calls is sure to be cured by a decent comp-org class, it can have the unintended side-effect of turning ...
JohnnyApplesauce's user avatar
2 votes
2 answers
79 views

I want to do an in-class demo for students. I am wondering if there's a way I can project my code editor for students to see, and still have a document with written code (like a cheat sheet) which ...
zephyr's user avatar
  • 21
3 votes
2 answers
91 views

Me and my friend are both in high school taking a “PLTW” Engineering class, where our goal is to design a solution to any problem and work on that solution over the course of the year. We’re reaching ...
Derrick Lwanjo's user avatar
13 votes
11 answers
4k views

At our University, we have in the first semester a very difficult C Introductory Course, that consists of presenting a shortened version of the language specification: What are for/while loops, if ...
Git's user avatar
  • 253
13 votes
6 answers
2k views

A big problem of learning alone is that you don't always figure out the preferred style for a language, the most "pythonic" (in the case of Python) way to do it, or how to write code in keeping with ...
auden's user avatar
  • 4,734
24 votes
10 answers
4k views

On open source projects and industry teams, there are often detailed style guides about how many spaces should be used for indents, line continuation, etc., and whether braces should go on their own ...
Ellen Spertus's user avatar
7 votes
5 answers
932 views

While reviewing someone's code I found many problems, such as writing lots of loops instead of a single loop. For example let's take the case of basic square matrix multiplication. Both matrices ...
i--'s user avatar
  • 841
8 votes
4 answers
756 views

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 ...
ItamarG3's user avatar
  • 6,322
7 votes
4 answers
204 views

Currently the only thing I'm teaching for the naming of identifiers is "be consistent". Then I go ahead and use the Hungarian notation consistently, and show them a few other conventions. Is there a ...
vacip's user avatar
  • 1,396
11 votes
9 answers
2k views

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 ...
vacip's user avatar
  • 1,396
5 votes
3 answers
210 views

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 ...
C Buzzman's user avatar
14 votes
11 answers
694 views

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 ...
thesecretmaster's user avatar
  • 4,815
12 votes
7 answers
714 views

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 ...
Aurora0001's user avatar
  • 3,536

15 30 50 per page