Uri Blass wrote:bob wrote:CThinker wrote:I agree with Bob that the chances of two original work being identical is relly low. Especially low for the resulting binaries to be identical.
However, what I disagree with is with the particular setjmp example.
First, it is argued that setjmp is so rare in usage, that, if it is found in a new code, then it must have been copied from Fruit. The reality is, the use of try/catch/jmp is very common and is a programming 'pattern'. When programmers see that there is process that can be interrupted and that its state is not needed, then one can simply restore from a saved state when interrupted.
Who, exactly, has said that? I only said that when comparing fruit and rybka, and seeing setjmp() in both, just shows that this is an even lower probability for a "by chance" accidental duplication by two independent programmers.
It is clear that Vas learned from the ideas in Fruit and one of the ideas is using setjmp().
Using specific function is an idea and it is not copy and paste.
While it is not my intent to be rude, neither is it my intent to go over and over these absolutely stupid arguments as well. I said, exactly, "if you find a lot of duplicate code (which has happened) and in that supposedly copied code you find a rare and generally considered bad technique, that this only increases the probability that code was copied. I did not say that setjmp() by itself proves anything at all. I did say that setjmp() in conjunction with what else has been found _is_ another small piece of the puzzle.
You keep talking about copying ideas. You do _not_ copy ideas and then write absolutely identical code "by accident". It doesn't happen. And to continually say it looks bad. Nobody believes that happens. Those of us that have been doing this kind of stuff for a long time _know_ that is doesn't happen. So let's get off of that ridiculous platform and move on. Duplicate code does not happen unless it is copied, when you define "duplicate" as " multiple blocks of dozens of lines." And it is time to stop beating that dead horse, because it is _not_ going to get up and run.
How do you learn from existing source programs?
One of the ideas is simply to write the program not by copy and paste big parts but by starting from scratch and adding part of fruit that you can compile and you can understand until you get the full program.
In the beginning you copy and paste only some variables and some structures that you understand what they do and also add empty functions that you understand their job.
Later you understand the content of some function that is not dependent on functions that you did not write.
After understanding it you can give yourself an exercise to
write a function that does the same thing without copy and paste.
And when you finish you don't have multiple blocks of duplicate code. If you do, you _did_ cut and paste.
When you are succesful you get to the next function and continue with this way until you build the all program.
I think that this is the best way to understand a chess program.
At this stage you did not write your own chess program.
It is a lot of work and I did not do it but I imagine that you will have similiar parts if you start from scratch after doing it.
Who cares? We are not talking about "similar" we are talking about "identical" which is a _huge_ difference.
If after all this work you are attacked and people claim that you broke the GPL then it does not encurage programmers to really understand source of other people and I believe that reading is not enough to understand
and you may misunderstand some parts.
Uri
It just encourages programmers to obey the law and not steal code written by others and shared with the world, without sharing the result with the world as well. this isn't that hard to understand. If it discourages some from doing so, then perhaps they had no business in the field anyway.