this post was submitted on 10 Feb 2026
285 points (95.5% liked)

Programmer Humor

30442 readers
1711 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] Flipper@feddit.org 32 points 1 month ago (3 children)

Deref is for smart pointers and not for inheritance.

[–] Phoenix3875@lemmy.world 19 points 1 month 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 1 month 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 1 month ago

Also sometimes newtypes