Nothing wrong with copying an algorithm, unless there is a patent.syzygy wrote: ↑Thu Apr 18, 2024 11:23 pmGood development practice is not writing a chess engine at all because there are plenty of engines already and you can just use one of those.
In principle I agree with you that not re-inventing the wheel is a good thing, but someone who starts writing a regular chess program will in most cases not do that for the end result (yet another chess engine) but for the (learning) experience. Why would one want to reduce that experience by copying someone else's code?
(Of course in reality there is nobody that could write a half-decent engine entirely from scratch without at least looking at some high-level code. So there will inevitably be some kind of borrowing, and that is fine. And if you want to borrow more than I would like to myself, then that is perfectly fine too (as long as copyrights are respected etc.). And once you have something that plays somewhat decent legal chess without crashing and want to add TBs, then by all means just copy the code from somewhere else.)
But copying code (beyond fair use) is illegal unless the copyright of the original code allows it and the original license is obeyed.
In my opinion (and I am not a legal expert) a short code snippet with attribution in the code is fair use (and the release notes should also mention this use if the source code is not available to the public for the new engine).
Now, with a public domain program, there are no requirements and CPL is very similar.
There are fairly liberal license types such as BSD and Mozilla which just require attribution.
GPL requires that the new code be published
Ordinary copyright requires permission for anything beyond fair use.
I do realize that many people ignore these standards. But that is neither here nor there.