Celius wrote:
Maybe it's just me, but don't you feel kind of bad copying and pasting someone else's code? I feel cheap doing it, like I didn't work for it. And also, aren't there like legal issues regarding that? I don't know much about that.
No if the code was meant for that in the first place. For example, when I'm using the Famitracker sound driver, I'm not copy pasting the code: I'm just including the module to my project with the linker provided by cc65. In that case this is not copy & paste practice at all, I'm just re-using a module that was made available for this purpose.
Regarding legal issues, it depends what the author decided to put the code under which licence.
Celius wrote:
Also you should rewrite it because it gives you practice programming and you may catch a bug that would be caused if you just copied/pasted it.
If it's only a few lines of code that you saw in a sample that uses specific variables (i.e. is not a function that you can call easily) then yes, you have to re-write it since the code could be very specific to this sample and it could have some impact when using. When it's a fully independent module then no, you don't have to. So basically, you have to use your own judgment to see what you have to re-write or not.
On the nes it may not be easy to reuse code since it may be too specific for the game but on other platform this is more common.