hono4kami@piefed.social to ProgrammingEnglish · edit-220 hours agoDon't DRY Your Code Prematurelytesting.googleblog.comexternal-linkmessage-square27fedilinkarrow-up1100arrow-down17file-text
arrow-up193arrow-down1external-linkDon't DRY Your Code Prematurelytesting.googleblog.comhono4kami@piefed.social to ProgrammingEnglish · edit-220 hours agomessage-square27fedilinkfile-text
minus-squarePieMePlenty@lemmy.worldlinkfedilinkarrow-up19·1 day 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-up4·1 day 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