That often depends on how familiar you are with a code base, and your personal knowledge about for example linear algebra or whatever specific thing is going on somewhere.
Obviously there is no objective "right" in this matter, but always writing code that the greatest idiot can understand obviously isn't good either.
Another problem with the duplication approach is that I'd you need to make some change later on, you need to apply it to 12 places and are pretty much guaranteed to mess up one of them, since this is the most boring task ever and your brain switches to lie power auto pilot after the third instance.
Either you need to change 12 places and test those 12 (or whatever) use cases, or make one change and still test those use cases. Only with the DRY function, as the article says, it’ll wind up accumulating options and configuration to accommodate all those use cases, becoming a big hairy abstraction that’s harder to understand for any of those use cases, whereas with the duplicated functions they would all evolve separately and in isolation and remain independently simpler.
Obviously there is no objective "right" in this matter, but always writing code that the greatest idiot can understand obviously isn't good either.
Another problem with the duplication approach is that I'd you need to make some change later on, you need to apply it to 12 places and are pretty much guaranteed to mess up one of them, since this is the most boring task ever and your brain switches to lie power auto pilot after the third instance.