In over ten years of professional programming, I have never used inheritance without regretting it.
When it’s the right tool, it’s incredibly useful. When it’s the wrong tool, and it often is, it racks up tech debt at an incredible rate.
It works great for technical constructs. E.g. A Button is a UI element. But for anything business logic related, yeah it’ll suck.
I’ll say this now.
Inheritance is the most misused capability of OOP which programmers think makes their code look smart, but most of the time just makes a giant fucking mess.
Hold on, I’m in the middle of drawing an inheritance graph so I know how Dog is related to AircraftCarrier.
Composition over inheritance every day, all day
I LOVE TRAITS. YOU’LL HAVE TO TAKE THEM FROM MY COLD DEAD HANDS
[Insert SpongeBob screaming meme]
TRAITS ARE SO USEFUL AND STRUCTS ARE EASILY REPRESENTED IN MEMORY AND WORKED WITH, COMBINED THEY WILL TAKE OVER THE LINUX KERNEL AND THE WORLD





