Using other people's code

Learning to program in any new context is a zig-zag affair. You need to read and play with sample code, read technical documentation, build new projects on top of starter templates, talk to other people both more and less experienced than you, etc. Often, you need to struggle on your own to fully internalize a concept or technique; other times, you just need somebody to show you.

Sometimes when you are solving a computer programming problem, you find help in the form of somebody else's code. But what code is acceptable to use in your CS class assignments and personal projects, and what responsibilities do you accept by using it?

This document will provide a partial answer for an academic context, but the questions are also important for professional programmers.

Academic integrity at Carleton

Carleton has a policy on academic integrity. This policy applies to all your academic work at Carleton, so you should familiarize yourself with it. Really, read it right now—it's only 490 words.

Licenses

Many modern code reference websites use some variant of the Creative Commons licenses, which are designed to be enforceable in as many countries' legal systems as possible. For example, the license known as Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) currently covers the code that people post in discussions on Stack Overflow.

Suppose you choose to adapt, build upon, or copy some code that is covered by one of the "Attribution-ShareAlike" licenses. If you distribute your resulting code (e.g. hand it in as a class assignment, post it online, sell it to a customer, or email it to a friend), you take on responsibilities delineated in the license. See each specific license for complete details, but for most of the Creative Commons licenses, your main responsibilities are:

There's lots more to it, but that's the gist. Check out the Creative Commons website for a wealth of additional information.

(Note that this stuff can get very complicated. For example, what happens if you adapt chunks of code from more than one author under more than one license? Distributing your adaptation then involves you in multi-licensing issues. Here are some relevant discussions.)

There are many other software licenses in common use, each of which grants some rights and imposes some responsibilities. For example, there's the MIT License, the Apache License, the GNU Free Documentation License, and the GNU Public License. As a general rule, it's important to pay attention to what license covers any code you plan to copy or adapt within your own software.

Additional issues in CS class

When you're writing software for a college class and you want to use or adapt somebody else's code, there are some additional things to consider. For example:

Rough guidelines

The final word on what's acceptable in class comes from your professor and the college's policies. But here are some guidelines for your behavior that are likely to serve you well as minimum requirements no matter what class you're in.

Last updated by Jeff Ondich, 29 December 2022.