331
OOP at home: (feddit.nu)
you are viewing a single comment's thread
view the rest of the comments
[-] Flipper@feddit.org 41 points 3 weeks ago

Deref is for smart pointers and not for inheritance.

[-] Phoenix3875@lemmy.world 23 points 3 weeks ago

Let me introduce you to this horror story: Deref Polymorphism https://rust-unofficial.github.io/patterns/anti_patterns/deref.html

[-] calcopiritus@lemmy.world 4 points 3 weeks 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.

[-] jenesaisquoi@feddit.org 2 points 3 weeks ago

Also sometimes newtypes

this post was submitted on 10 Feb 2026
331 points (95.8% liked)

Programmer Humor

30224 readers
401 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS