O'Reilly logo

Advanced Object-Oriented Programming in R: Statistical Programming for Data Science, Analysis and Finance by Thomas Mailund

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Thomas Mailund 2017

Thomas Mailund, Advanced Object-Oriented Programming in R, 10.1007/978-1-4842-2919-4_3

3. Implementation Reuse

Thomas Mailund

(1)Aarhus N, Denmark

The easiest code to write is the code that is already written. If you can reuse existing code, it is always better than writing new code. You don’t have to spend time writing the code, and if the existing code has been around for a while there is a good chance that it is well tested and thus more likely to be correct than the new code you introduce. So your aim as a programmer should be to write as little new code as possible, paradoxical as it sounds.

The way to reuse code, however, is not to copy chunks of existing code from one place in your program and paste it into another. You ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required