148 votes
Accepted

Is it bad to force my students not to return early?

Actually returning early should be the norm. Return as soon as you can. There are at least two reasons for this, of which the first, efficiency, is the least important. But if you return early then ...
  • 35.3k
54 votes

Should CS students be doing their tests on paper?

100% yes. In beginning courses, it's practically a cognitive requirement. Let me see if I can break down for you why it is so important. It comes down to what we can know that the student knows. ...
  • 31.8k
51 votes

Is it bad to force my students not to return early?

Teach your students about the return early philosophy. Teach your students about the single return philosophy. Tell them this ...
  • 619
50 votes
Accepted

Should CS students be doing their tests on paper?

Edit: This relatively high voted answer seems to be confusing to some, as it does not seem to give a clear answer. TL;DR: yes, doing tests on paper is usual at least in my university, at least many ...
  • 1,379
38 votes

How do you deal with Lone Rangers in group projects?

This is really a separate approach from my first answer, which has received some push-back. It's worth noting that many of these loners are simply students who are substantially ahead of the curve. ...
  • 31.8k
37 votes
Accepted

Demonstrating the possible dangers of SQL injection

The best way to show your students that their work is vulnerable to SQL injection is to demonstrate it. I'd suggest that you challenge the students to "hack" each others projects using SQL injection. ...
  • 4,775
35 votes
Accepted

Problematic student at a very high level

The best way to deal with this kind of student is to head it off at the pass. If you can get the student at the beginning, you can often prevent the problem from festering in the first place. I have ...
  • 31.8k
33 votes

Is it bad to force my students not to return early?

Is it a wrong approach, giving your students the choice? Or is it wrong to force them never to return early? This is a false dichotomy. Sometimes multiple returns are clearer, and sometimes (rarely) ...
  • 439
31 votes
Accepted

Explaining access levels and visibility in OOP

Here's an analogy that I've used for several years, and that students seem to understand. It doesn't focus on the rules, but why we have public and private and protected. "Most of you know that I ...
24 votes

Should CS students be doing their tests on paper?

Although most of the answers here seem to be in agreement that coding tests should be done on paper, I would like to offer a different opinion. Any test that includes coding would benefit the student, ...
24 votes

How do you teach Big O to high schoolers with varying degrees of math exposure?

One good overall educational strategy is to teach the same thing to students repeatedly, using a Spiral approach, in which each turn of the spiral teaches at a deeper level. Don't expect the students ...
  • 35.3k
21 votes

Dealing with students who complete labs very quickly

I have 3 tiers of labs. First are the required labs. They're worth 100 points each and every one must do these. If they don't do one, it goes in the gradebook as a zero. These are also the labs that ...
  • 3,029
19 votes

Should CS students be doing their tests on paper?

Speaking as a former student and as a coder: yes. Perhaps there's an element of in-my-day geezerism here, but under the assumption that by "on a computer" you mean "in an IDE" I'll point out that ...
18 votes

Demonstrating the possible dangers of SQL injection

A couple suggestions - The classic xkcd comic about Bobby Tables: Shown, complete with the explain xkcd article can provide a nice, humorous introduction that will get them to start paying to ...
  • 4,684
16 votes
Accepted

How can we motivate students to review each other's code?

You have an opportunity for several things here: You can make it a small-team effort rather than a whole-class thing. Say, a team of about 5. The team reviews everyone's code in sequence so all get ...
  • 35.3k
15 votes

How can I design online tests and prevent cheating?

I don't think there are any published tools to generate programming assignments, though there are articles that describe such tools (such as this one from a CUNY, or this one from Croatia, so one ...
  • 31.8k
14 votes

Should CS students be doing their tests on paper?

As a student who went through 4 years of undergraduate in computer science, writing all my exams on paper, I do think there are advantages to a paper exam. If you need an IDE to tell you the things ...
  • 773
14 votes

How to deal with students that don't like CS?

On the first day of class, I ask students how Google search can work -- returning an answer to any query over billions of web pages in a fraction of a second. Usually someone mutters "magic". I say, "...
13 votes

Explaining access levels and visibility in OOP

What my teachers used was the following example, which is pretty simple and most people understood. Your father orders a pizza. The delivery guy arrives and expects payment. The ...
13 votes

Is it bad to force my students not to return early?

When I learnt Eiffel, I realised that a single return at the end of a function is the way to go. Eiffel does not have a return. You just set the value of the Result variable, and it is returned at the ...
12 votes

Problematic student at a very high level

You said he refuses to work, but has mastered the material. How do you know he's mastered the material? I've had students like this in the past. They'll finish 2 weeks worth of assignments in a day ...
  • 3,029
12 votes

Should CS students be doing their tests on paper?

Speaking as a former student, a coder & a teacher: yes. In addition to the points raised by G. Ann, I would add the following: Problems on tests are typically far simpler than full real world ...
  • 414
12 votes

Should CS students be doing their tests on paper?

Speaking as a former student, a former competitive programmer, a real world programmer, yes. Forcing student to write code on paper is not pointless. It has following benefits: Giving you syntax ...
  • 221
12 votes

Should CS students be doing their tests on paper?

Maybe some complementary points to what as already been said (as a CS assistant professor, giving both theoretical and practical courses). Even for practical courses (those which involve coding), ...
12 votes
Accepted

How to stress the importance of testing code?

Introduce test-driven development. TDD and agile methods of development are very popular at the minute, and for good reason — you know, ahead of time, exactly what each part of the program must ...
  • 3,496
12 votes

The order of subjects in beginner's curriculum

We teach AP CS assuming that our students come to us with no prior computing background. Being that the language for AP CS A is Java, we plan our sequencing accordingly. We don't follow the approach ...
  • 171
12 votes

Is it bad to force my students not to return early?

Speaking as a computer science professional (not an educator) with over 40 years of experience, the important thing to teach is discipline. Would-be programmers need to understand that code which is ...
  • 221
11 votes

Demonstrating the possible dangers of SQL injection

If you search 'computerphile SQL injection' on google, it should bring you to the link below. The man in this video explains SQL injection very clearly and uses a practical example as well by breaking ...
  • 111
11 votes

Explaining access levels and visibility in OOP

Ooh, this is one of my favorite lessons! I don't introduce package private and protected in the same lesson as private and public, because there are 3 principles that I want them to absorb that ...
  • 31.8k
11 votes

How do you deal with Lone Rangers in group projects?

I might push back against the core idea here, and this gets to the idea of the central mission of the course of study. Within my course, teamwork is not a primary goal upon which I will assess my ...
  • 31.8k

Only top scored, non community-wiki answers of a minimum length are eligible