this post was submitted on 10 Feb 2026
313 points (95.6% liked)

Programmer Humor

31081 readers
515 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 40 points 2 months ago (3 children)

Deref is for smart pointers and not for inheritance.

[–] Phoenix3875@lemmy.world 20 points 2 months 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 2 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.

[–] jenesaisquoi@feddit.org 2 points 2 months ago

Also sometimes newtypes