Hellfire103@lemmy.ca to Programmer Humor@programming.devEnglish · 7 days agoTIFU by not using objects in my object-oriented programming courseworklemmy.caexternal-linkmessage-square24fedilinkarrow-up11arrow-down10cross-posted to: programmerhumor@lemmy.ml
arrow-up11arrow-down1external-linkTIFU by not using objects in my object-oriented programming courseworklemmy.caHellfire103@lemmy.ca to Programmer Humor@programming.devEnglish · 7 days agomessage-square24fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareKache@lemm.eelinkfedilinkarrow-up0·edit-27 days 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.