hono4kami@piefed.social to Programming@programming.devEnglish · edit-24 days agoDon't DRY Your Code Prematurelytesting.googleblog.comexternal-linkmessage-square29fedilinkarrow-up1105arrow-down18file-textcross-posted to: hackernews@lemmy.smeargle.fans
arrow-up197arrow-down1external-linkDon't DRY Your Code Prematurelytesting.googleblog.comhono4kami@piefed.social to Programming@programming.devEnglish · edit-24 days agomessage-square29fedilinkfile-textcross-posted to: hackernews@lemmy.smeargle.fans
minus-squarePieMePlenty@lemmy.worldlinkfedilinkarrow-up24·4 days agoUltimate DRY: just keep refactoring the one method to accept hundreds of parameters and do everything. Add two numbers? DoIt(1, 2); Subtract? DoIt(null, null, 3, 1); Etc.
minus-squareGurfaild@feddit.orglinkfedilinkarrow-up5·4 days agoinvokeOperation(new Object[]("multiply", 2, 5))
Ultimate DRY: just keep refactoring the one method to accept hundreds of parameters and do everything.
Add two numbers? DoIt(1, 2);
Subtract? DoIt(null, null, 3, 1);
Etc.
invokeOperation(new Object[]("multiply", 2, 5))
This guy seniors