4

Whenever I find a great solution for a critical issue and I use code snippets from Stack Overflow, I always feel the urge to write a comment that tells that "this answer/question provided the solution that the following code uses".

Is this fashion done by anyone else? Is it beneficial to do?

Consider the fact that I'm working on a hobby project only, so nothing official or actual work-related.

7
  • 11
    I think doing this prevents people from asking why on earth did you do this or what proof do you have for this ?. Yes, its beneficial. It saves a lot of time and googling :)
    – TheLostMind Mod
    Commented Apr 3, 2016 at 16:11
  • I'll do this when the answer on Stackoverflow goes into greater detail and depth of explaining an issue than I want to write in a comment. Usually I just write the gist of it in the comment and provide the link for further reading.
    – Magnus
    Commented Apr 3, 2016 at 16:52
  • @TheLostMind the best type of link rot is link rot to useful information in code \o/
    – PeeHaa
    Commented Apr 3, 2016 at 16:56
  • @PeeHaa link rot is quite rare on Stack Overflow, isn't it? Commented Apr 3, 2016 at 17:02
  • Very much not so. Questions and answers get deleted often.
    – PeeHaa
    Commented Apr 3, 2016 at 17:06
  • @PeeHaa that is sad to hear, but makes sense. Do you think is there any methods to prevent it? for example, post the solution as a gist to GitHub, with a link back to SO? Commented Apr 3, 2016 at 17:08
  • 1
    Imo links to SO are fine for giving attribution for explaining what your code does not so much. Unless it really cannot explained in a comment. I'm writing code I don't want to go to random site x to find out why a piece of code does what it does.
    – PeeHaa
    Commented Apr 3, 2016 at 17:09

0

Browse other questions tagged .