A programmer may obtain some source code for some new method to save some time reinventing some wheel. If any adaptation is necessary the programmer will handle this in turn. Code is not reused blindly, but after a careful evaluation of how it fits into the existing work.If you look at this forum (and other ones dealing with MCUs) you will find hundreds of people who got a working program from somehere and they cannot make it work on the same controller it was written for, yet alone on another architecture.
A script kitty will copy and paste code from any source with little to no understanding of its intended use, compiler requirements, hardware requirements, any requirements in general are ignored since programming is hard.
I write code. I also reuse Microchips libraries on a frequent basis. While there have been some issues (like a week tracking down a driver bug for a color TFT screen) those efforts have always been a small fraction of the time to rewrite any of these libraries.