Hellfire103@lemmy.ca to Programmer Humor@programming.devEnglish · 20 hours agoTIFU by not using objects in my object-oriented programming courseworklemmy.caimagemessage-square21fedilinkarrow-up179arrow-down13cross-posted to: [email protected]
arrow-up176arrow-down1imageTIFU by not using objects in my object-oriented programming courseworklemmy.caHellfire103@lemmy.ca to Programmer Humor@programming.devEnglish · 20 hours agomessage-square21fedilinkcross-posted to: [email protected]
minus-squareKache@lemm.eelinkfedilinkarrow-up1·edit-23 hours ago inheritance to avoid code duplication What no, inheritance is not for code sharing Sound bite aside, inheritance is a higher level concept. That it “shares code” is one of several effects. The simple, plain, decoupled way to share code is the humble function call, i.e. static method in certain langs.
What no, inheritance is not for code sharing
Sound bite aside, inheritance is a higher level concept. That it “shares code” is one of several effects.
The simple, plain, decoupled way to share code is the humble function call, i.e. static method in certain langs.