Is copying cheating or something ok for a programmer to do?

Hello! I’m a beginner developer starting to learn how to code. Currently, I’m on the last challenge of the freeCodeCamp responsive web design challenges, the one whereby you create a personal portfolio, and at times when I find it hard to create something, I go back to the example set out and I feel like I’m cheating. So the question here is: Is it ok for developers to check other people’s code to copy and use in their projects? Or should they just think for themselves and do the work?

hi @Lewis2

i always search and take a look at others people code, to learn from it. as i learnt from examples.
you will get some ideas if you have time to see other people work.

in my opinion, it’s not cheating if you copy some of the codes to be applied. but it would be cheating if you copy all the code, without knowing how to applied with your work.

regards

1 Like

@Lewis2 I generally see other people work for some inspiration, It is not cheating But If you ditto copy and paste other people work and you can’t understand what is the logic in it, so this is bad practice.
If you need to copy and paste other people work then play with that code and try to understand basic structure of that code and If you have some time so add some new feature in it.

1 Like

“I understand that plagiarism means copying someone else’s work and presenting the work as if it were my own, without clearly attributing the original author.”

“I understand that plagiarism is an act of intellectual dishonesty, and that people usually get kicked out of university or fired from their jobs if they get caught plagiarizing”.

“Aside from using open source libraries such as jQuery and Bootstrap, and short snippets of code which are clearly attributed to their original author, 100% of the code in my projects was written by me, or along with another person going through the freeCodeCamp curriculum with whom I was pair programming in real time.”

“I pledge that I did not plagiarize any of my freeCodeCamp.org work. I understand that freeCodeCamp.org’s team will audit my projects to confirm this.”

This is the freeCodeCamp Academic Honesty Pledge that you sign before claiming a certificate.

3 Likes

It seems like you are asking two different questions here:

  • “Is copying cheating?” (in the context of FCC learning)
  • “[Is copying] something ok for a programmer to do?”

Is copying cheating? Yes and no. It is about the extent of copying and what you do with it. If you need a CSS spinner for your project, there is a difference between:

  1. Searching for a CSS spinner and cutting and pasting the code in.
  2. Trying to build one, researching it, getting stuck, hopping on Stack Overflow and finding someone having the same problem, “Oh, that’s how they solved that problem!”, adapting that idea into what you are doing, getting stuck on another problem, finding another person who solve that problem, “Oh, they used that property? What’s that?”, researching that, and then using it once you understand it, etc.

I don’t think there is an expectation that you will hide in an Antarctic snow cave while you work on these projects. But I would ask myself: Do I understand what I am using? Could IO explain how it works? Is this sufficiently my own work or is it a lot of cut and paste?

A basic test I like is - If I could reproduce it and explain it, then I have absorbed it well enough that, while I may have learned it from what someone else did, it is now part of my repertoire too.

Now for your other question: “[Is copying] something ok for a programmer to do?”

No, programmers never, never, never copy anything.

Oh wait, the opposite of that.

Sure, we copy. But it should be done responsibly. I am working on something and just the other night I needed a function to shuffle an array of elements. Now, I know that the Fisher-Yates algorithm is the way to do it, but I can’t remember it off the top of my head. Rather than spend 30 minutes trying to work it out by memory, I google it and cut and paste a solution into my code. Then (AND THIS IS IMPORTANT), I read through it and make sure I understand it (nothing goes in my code without me understanding it, period) and then I adapt it to my specific needs and coding style.

Is that stealing? Well, it was code out in the public. The algorithm isn’t copyrighted and with the exception of variable naming, there aren’t that many ideal ways to implement it. But it was a few lines of code of a common algorithm.

Now, If I have copied 1000 lines of someone else’s library - that would be a problem.

But yeah, people copy all the time. I just copied a few lines out of the docs for a library I’m using, which is of course completely legitimate. It’s a matter of degree.

7 Likes