▲ 330 ▼ OOP at home: (europe.pub) submitted 8 months ago by freddo@feddit.nu to c/programmer_humor@programming.dev 89 comments fedilink hide all child comments
[–] Flipper@feddit.org 41 points 8 months ago (3 children) Deref is for smart pointers and not for inheritance. permalink fedilink source hideshow 3 child comments replies: [–] Phoenix3875@lemmy.world 23 points 8 months ago Let me introduce you to this horror story: Deref Polymorphism https://rust-unofficial.github.io/patterns/anti_patterns/deref.html permalink fedilink source parent [–] calcopiritus@lemmy.world 4 points 8 months ago The windows crate is full of Deref. Because the windows API is full of inheritance. It may not be what the trait was thought of for, but I'm glad we have it to interface with APIs that have actual inheritance. permalink fedilink source parent [–] jenesaisquoi@feddit.org 2 points 8 months ago Also sometimes newtypes permalink fedilink source parent
[–] Phoenix3875@lemmy.world 23 points 8 months ago Let me introduce you to this horror story: Deref Polymorphism https://rust-unofficial.github.io/patterns/anti_patterns/deref.html permalink fedilink source parent
[–] calcopiritus@lemmy.world 4 points 8 months ago The windows crate is full of Deref. Because the windows API is full of inheritance. It may not be what the trait was thought of for, but I'm glad we have it to interface with APIs that have actual inheritance. permalink fedilink source parent
[–] jenesaisquoi@feddit.org 2 points 8 months ago Also sometimes newtypes permalink fedilink source parent