Not every coding mistake makes it into the news but one did recently which carries a cautionary message for students (and others who code.) Nissan app developer busted for copying code from Stack Overflow It’s funny in a way. It’s not so gunny in other ways.
Long story short, a developer copied some code from the website Stack Overflow where many developers help out with code samples, hints, tricks and other information. It’s likely no one would have noticed if they hadn’t included that revealed the source of the code. That’s the funny part. The not funny part is that this was not caught in the review process for code entering the product.
Now it’s been a long time since I wrote code that shipped in a commercial product but back then code did not make it into the official build without being reviewed by two other developers. One would like to think that this sort of process still exists and that people actually read the code. I know I always read code I was asked to review very closely.
Reusing code is a perfectly acceptable practice in professional development. We even used to joke that one should “steal from the best.” But of course one is always expected to fully understand the code one is reusing. Students share code all the time as well. This can be a problem for teachers since projects are assigned (at least in part) to determine what students have learned. So a student who uses code they don’t understand is really cheating. They are cheating themselves but they are also devaluing the grades. Both are sad really.
Students have been copying from classmates for years. Well probably for as long as we’ve had grades. Copying from the Internet is newer but seems to be growing in frequency. Often times this is easier to spot as code shows up that is very different and even beyond what has been covered in class. Other times it is not as easy. I don’t always have a problem with this. If the student really understands what they are using getting code from the Internet can be a good thing. When they use code without understanding it problems ensue.
Often I see students using code from the Internet because they don’t understand it well enough to incorporate it in with the code that they have written themselves. This can be a good learning experience.
Generally I think reading the code written by other people can be a very good thing. I know I learn a lot from that process. The only time it really is a problem is when students don’t actually learn from it.