Hacker News new | ask | show | jobs
by celeritascelery 2402 days ago
It’s hard to draw the line though. Is using stack overflow’s answers wrong? What about getting an algorithm from a text book? Obviously lifting an entire course is wrong. But nothing is created in a vacuum. Especially code, which feels more like math then English.
1 comments

When you take an algorithm from a book, or copy and paste from stack overflow, you put a comment in the code with a link to the source, really no different than how you'd cite a quote in a paper.

To me, it just doesn't seem like it's even remotely challenging to figure out how to do this, or when to do this. If it's not yours, say where you got it.

When in doubt, cite it. What exactly would the harm be if you cited something when you weren't sure if it was necessary, anyway?

> When you take an algorithm from a book, or copy and paste from stack overflow, you put a comment in the code with a link to the source, really no different than how you'd cite a quote in a paper.

You do this? That is very impressive. I have never meant anyone who did that. Myself included.

I tend to put a link to the SO answer in a comment. That way whoever is looking at it later (mostly me in a few months) can understand what prompted that solution.