4 ms·
> If we encourage the DRY paradigm in the whole development cycle, copy/pasting a function is just a further reach of such paradigm. No, it's the opposite. The
by lmm 11y ago
> If we encourage the DRY paradigm in the whole development cycle, copy/pasting a function is just a further reach of such paradigm.
No, it's the opposite. The whole point of DRY is you don't copy/paste, you put the thing in a common place and have references to it.
Many SO answers are good enough to be libraries. But they should be libraries, not snippets that are copied and pasted. Fortunately we're moving in that direction - our library infrastructure is becoming good enough that it's worth releasing even small pieces of code as reusable libraries, and people are.
- drdeca 11y agoI'm not sure how linking (as part of compiling) works. I thought how it worked was by copying the compliled thing from other files into the same executable. Is this not the case?
- lmm 11y agoOld-school static linking works like that. Dynamic linking no, though I guess you could argue it's copied in memory at runtime. But even if there's copying going on at the implementation level, it's an important conceptual distinction to make.