I struggle with this as I like DRY concepts, but at work, I develop over the top of an already established platform with fairly strict constraints.
While they do a pretty good job in making inheritance easy, sometimes things don't quite fit the bill. This occasionally results in me having to pinch a bit of code outside the scope of what I'm doing, but not available to call independently.
I agree it's best to have a balancing act. Copying and pasting within the same OOP file is clearly not good practice. However, if re-using something that isn't easy to access, and doesn't really fit with what I need, sometimes copying a little code is the lesser of two evils.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I struggle with this as I like DRY concepts, but at work, I develop over the top of an already established platform with fairly strict constraints.
While they do a pretty good job in making inheritance easy, sometimes things don't quite fit the bill. This occasionally results in me having to pinch a bit of code outside the scope of what I'm doing, but not available to call independently.
I agree it's best to have a balancing act. Copying and pasting within the same OOP file is clearly not good practice. However, if re-using something that isn't easy to access, and doesn't really fit with what I need, sometimes copying a little code is the lesser of two evils.