this post was submitted on 10 Feb 2026
187 points (95.2% liked)

Programmer Humor

29635 readers
2143 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 27 points 16 hours ago (3 children)

Deref is for smart pointers and not for inheritance.

[–] calcopiritus@lemmy.world 2 points 7 hours 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.

[–] Phoenix3875@lemmy.world 16 points 15 hours ago

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

[–] jenesaisquoi@feddit.org 2 points 16 hours ago

Also sometimes newtypes