5 ms·
I've always wondered what the chances of two people writing the same chunk of code are.
by teamhappy 11y ago
I've always wondered what the chances of two people writing the same chunk of code are.
- richerlariviere 11y agoWe could extrapolate this to the music field also.
- hyperpallium 11y agoI got to mark an assignment at uni that I'd also done. There seemed to be just three different versions that were "obviously" copied... then I saw one identical with mine! With just wminor differences. I hadn't copied, and I couldn't see how they could have copied mine. On reflection, there is much convention in code (this was c IIRC), loops, indices and cordinates variables are standard. And, each level of a problem only has a few obvious ways to approach it. The same underlying algorithm - especially in a uni course about algorithms - also tends to suggest particular designs. The eye of an octopus is striking similar to the human eye. Does that mean they are related, other than by objective?
- nunobrito 11y agoThis could be an investigation work to get hard data. From personal experience would say that exist many cases where a given code can only be written in a given manner. On other cases, people simply copied the code many years ago and never again know where it can be found. For me, more relevant is to compare the variable names. If both code snippets have very similar variable names, then one of them is likely a copy.
- osivertsson 11y agoI've seen cases where names where changed, but comments retained with the same typos as in the GPL package...
- nunobrito 11y agoYes. Found this once on the code from a Chinese developer. Really made a big effort to rewrite the code but then the comments were done in a too perfect English that made it obvious as copied from elsewhere.
- jgh 11y agoI've found a couple of Chinese companies offering compiled versions of my open source code before...They would change the class names and stuff but keep all the interface methods the same so it was pretty easy to figure out what they had done.
- koenigdavidmj 11y agoRumor has it that two of the original UNIX guys (Thompson and Ritchie, I think) once wrote the exact same ~20 line program in PDP-11 assembly.
- hyperpallium 11y agosorry, I accidentally mobile-downvoted. It's a good comment.