| ▲ | ChrisMarshallNY 2 hours ago | |
In my experience, the answer is always "It Depends." That's about the only thing that I can hang "always" on. It really depends on the exact type of code we're working with, and what our objectives are. In my case, I often use object inheritance. It's a damn cheap way to DRY. However, when people hear "inheritance," they often think "polymorphism." There's a really big difference between the two, but popular culture has jammed them into one ball, and it's not worth the agita, to try to explain the difference. But if you are doing optimization, long stacks can be your enemy, and inheritance tends to have long, windy stacks. In these cases, the copy/pasta method may well be the best approach. Like I said, "It Depends." | ||
| ▲ | tomjakubowski a minute ago | parent [-] | |
[delayed] | ||