r/ProgrammerHumor • • 1d ago

Meme dynamicProgramming

Post image
5.3k Upvotes

140 comments sorted by

View all comments

Show parent comment

17

u/DiamondDramatic9551 1d ago

don't put two unrelated things in the same inheritance tree, dumbass".

Maybe prefer composition over inheritance in the first place. 

3

u/zyxzevn 1d ago

A lot of the design patterns come from the lack of certain features in the language.

In the OOP Smalltalk language many of those patterns are a waste of time. Because they can be replaced with a simple Closure or Lambda. Smalltalk was based on Lisp.
Java and C++ did not have that at the start. So we have visitor-pattern, iterator-pattern, etc.

2

u/NomaTyx 1d ago

yeah that too, i was specifically talking about the bridge design pattern, which i really feel like is what most people would do even without being taught it.