How to deal with the wealth of "help" available for programming assignments?

Most people should require nothing more than the textbook and my lectures.

Probably most professional programmers today could do their jobs armed with nothing but the lectures from their programming coursework and the complete official reference material for the programming languages and libraries they are using. But why would they, when there are much more useful resources available online that allow them to do a better job, more quickly?

Your students (understandably) approach this the same way. Why would they do their homework with just the textbook and lecture notes, when this isn't the most efficient way (with respect to time, getting a good grade, and actually learning)? (Yes, the Internet can be a tremendously useful aid for learning and not just copying.)

In my experience, the best way to deal with students using online resources is:

  • Encourage students to use online resources. Recommend specific online resources to them that you consider most helpful and reliable.
  • Require students to cite all the online resources that they used. (And depending on the assignment, to also explain how they used it.)
  • Educate students who use online resources that are flawed about how to better evaluate the online resources they choose to use. ("This website seems useful at first glance, but it actually doesn't apply to the problem in the homework assignment. Here is how you could have known that...") If you do this successfully, this will probably be the most valuable thing they learn in your class.
  • Assign a mix of problems, including some that can't be answered immediately with a simple Google search.

If you want them to have some practice solving programming problems without the assistance of the Internet, you can occasionally give them a small (< 10 minute) problem to complete in class.


You may have the problem of actually giving assignments which are just too simple - so easy they can be effectively Googled - but not at the same time making it clear that this is building to a compound problem that isn't so easily looked up, while building up skills that will make them good at their job.

A simple example: use regex to check to see if an email address might be valid. In theory, this is to help students learn regular expressions, as well as developing their skills of debugging, problem solving, and familiarity with string-handling in their computer language. The problem? Students think the problem is just about checking to see if an email is valid. As a real programmer, you absolutely should not even attempt to build your own solution for this - Google it and find a high-quality implementation suitable for your needs, then conduct your own testing and make sure it works. But your students might only be learning how to copy-paste ineffectively, not testing, altering, or understanding, and they do not learn how to modify the solution to fit custom business rules.

So, in this example I would suggest you twist it. The new problem is "test to see if an email address might be valid, using regex". Encourage them to find a nice regex online if they'd like, or build one on their own if they want extra practice on regex. Now, part 2 of the problem: our business rules only allow certain email addresses in our application. We only want to allow addresses that have a '.edu' extension, and before the @ symbol there must be 3 numbers (of the form: [email protected]).

This is not a complicated problem, but now there are two parts: 1) you need to find or build a regex to check an email, and 2) you need to be able to change it so it supports a non-standard rule that's terribly hard to Google. Hey, if you can find an answer on Google, knock yourself out - cite it so I can see where you found it and you'd still get full credit.

You may even want to state the 'hard' version of the problem first, then note how this is actually a few sets of simple problems combined together - then assign those easy ones right from the book if you like.

This is also a perfect way to then have the small in class problem that ff524 suggested. If they did the problem, then they should have no trouble with a solution to a minorly modified version like "this time, we want 4 numbers and a .co.uk extension - and you can use the solution you turned in to help your memory". Done right, at least some students will hopefully get the idea that it's actually harder to take the shortcuts than it is to genuinely understand the material so they can solve any problem that comes up in the future.

As a closing remark: I tend to try to skip most "try this problem from the book" type of assignments as a student myself, especially in anything programming related, because I find them trivial and unrecognizable compared to the kinds of problems I deal with as an actual real-life professional. So I don't really blame other students for not wanting to do them, either. I try to skew all my programming tasks towards real-world issues, preferably grounded in personal experience or existing applications, but I realize this is not always possible for teachers. Still, a little twist goes a long way!


When I was about 13, I could guess the answer to most simple algebra problems and then check that my guess was a solution. My mathematics teacher explained that the objective was not to get the solution. The objective was for me to learn and practice techniques I would need later, for problems that would be too difficult for guess-and-check. Similarly, your programming students should be building up skills they will need to write programs they cannot just copy.

I don't know whether this would work or not, but it is something to try. Ask them to over-comment their programs, and give most of the grade for the clarity and quality of the comments.

They should begin by explaining the approaches they considered, and how they picked the one they actually coded.

Each line, or small group of lines, needs a comment saying what it is doing.

Whether or not they got the code from the Internet, they should demonstrate understanding of the purpose of every line in it. I find it easier to understand code at that level if I wrote it myself than if I am reading code someone else wrote.