Let's suppose that you were assigned a programming project, which is considered from your teacher/professor, not easy. However, you manage to find an online tutorial, that guides you step-by-step through the process needed (so the source code you have written doesn't have much difference from the one on that tutorial).

The final solution is based on this tutorial, but you have also added your own information, corrected some minor errors, etc. I don't know if this matters, but you know exactly what every single line of your code does, you are able to explain and answer complex questions, etc.

Is that considered plagiarism, and if yes, why? If not, how can somebody support that on a teacher/professor?

  • 2
    As always - cite your source. If your work is being part of an assessment, also say what added value you provided as compared to the material you used. If you do this, you do not plagiarise, and you also do not commit an assessment offence. Commented Mar 4, 2016 at 0:13
  • @CaptainEmacs The scenario that I was imagining is that you read a post on Stack Overflow on how to calculate the Fibonacci sequence iteratively, then the student is asked to submit homework on this or given a quiz, and unintentionally replicates the code from memory. Is that learning or is that plagiarism? Commented Mar 4, 2016 at 0:25
  • 1
    @CaptainEmacs Surely you wouldn't want students citing 50+ sources (from my experience, it could be far more) for every programming tutorial they looked at to aid them in their current homework assignment. At that point they would be spending more time managing their sources than they would learning the material. Commented Mar 4, 2016 at 0:30
  • 3
    @Arkoudinos In that case, Captain Emacs is right. Just cite it. In my undergrad I did this a few times when reading arcane tutorials, I added a comment at the top of my code that linked to the tutorial and gave a brief description of how I used it. Commented Mar 4, 2016 at 0:44
  • 1
    How do you decide if it's trivial? Guideline is: if something has probably only 3-4 distinct ways of being canonically done (such as Fibonacci), which are common knowledge, a citation may not be necessary (note, this implies the solution is very short; could also be from memory). If there is a non-canonical way of doing it which you picked up somewhere (e.g. treating Fibonacci as a matrix iteration, which is non standard in computer science treatments), it needs citation, even if it is short. Commented Mar 4, 2016 at 9:53

1 Answer 1


Using online material to learn is not plagiarism.

This is a great way to learn (e.g, worked examples and subgoal labeling) and is a common way for instructors to try to teach something. Am I plagiarizing every time I use a common design pattern? No.

However, copying and pasting code from online is. It gets a little fuzzy when working on simple assignments that can be found easily online because it could be weakly argued that you are recalling it from memory. I would definitely not be concerned about this, especially if you think you understand the code and were not trying to cheat.

If you're genuinely concerned, you could even discuss it with your instructor and they might realize that they are not spending enough time discussing a certain process or giving you enough practice material.

EDIT: Based on your clarification in the comments, if this is something more specific/arcane and not a tutorial on something general, then just cite it. I have done this in my programming courses before. I added a comment at the top of my code linking to the material I referenced and gave a very brief description of what it is and how I used it.

  • It would be a way to learn specific techniques or idioms. It is not a way to learn how to come up with your own solution, which is what programmers are paid to do. If the solution was already out there, the company would buy it, not pay someone to sit in a chair and type it in again. There is a lot to "learning to program", like any field which is creative and productive. The answers are not "out there", they are within you. I would rather see a badly worked out solution that was developed by someone through thinking and effort than an ideal one (or good one) taken by pasting things together.
    – user28174
    Commented Mar 14, 2016 at 1:45
  • "If the solution was already out there, the company would buy it, not pay someone to sit in a chair and type it in again." Assuming, of course, that the company is aware of its existence and that it fully matches the company's requirements. There are many programs that do much of the same stuff in a broad sense but differ in terms of the details (which is one of the reasons for the proliferation of programming frameworks/etc. that exist). Programmers shouldn't develop new algorithms to solve problems when existing algorithms do the job just fine unless their job is developing new algorithms.
    – JAB
    Commented May 15, 2017 at 17:04
  • 1
    Your logic is flawed. If the assignment was "write a database server" and someone would provide MariaDB source code the student flunked the assignment. If I pay a developer to do the same thing and she wrote her own database server I'd fire her. In order to learn it is imperative to do things that thousands of other already did before. Otherwise, no new concerto pianist would have to learn beethoven.
    – theking2
    Commented Mar 21, 2020 at 9:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .