3 ms·
If I cut and paste some code, even if not from Stack Overflow I'll document it. Partly because I want to attribute the code correctly, but also so that someone
by prewett 8y ago
If I cut and paste some code, even if not from Stack Overflow I'll document it. Partly because I want to attribute the code correctly, but also so that someone later can go back to the original source. The original source may have additional documentation, explanations, assumptions, etc. that people in the future may want to know. Plus it helps to know that this block of code is an external cut and paste and that modifying it should be done more carefully than other code.
This tends to only be for tricky or time-consuming algorithms. RGB to HSL/HSV, is point in a polygon, hash function, etc. Those point-in-polygon functions in particular can be densely optimized to the point that it is not obvious a) how it works, b) what the original algorithm was.