DEV Community

Discussion on: Getting your website to load in under 0.1 seconds

Collapse
 
urielbitton profile image
Uriel Bitton • Edited

how is is bad? Abstraction is important to not repeat code and reuse methods and functions.
I then said as much as possible, so where you can't abstract you don't.
Essentially to achieve dry practices, abstraction is exactly how you do that. When you see you shouldn't abstract then you don't, hence "as much as possible" or "wherever possible".

Please elaborate why you believe its not good advice?

Collapse
 
griffinsauce profile image
Joris Griffioen

You didn't look up WET did you? I'm not going to badly repeat what has been written by others way better, so do some research here.

One link that comes to mind is this: overreacted.io/goodbye-clean-code/

so where you can't abstract you don't

Yes, this is bad practice. You don't abstract because you can, you abstract when it helps. Abstraction introduces complexity, you have to balance the cost of that complexity with the benefits.

Abstraction is important to not repeat code and reuse methods and functions.

Repeating code is not a sin (see the link above). Every line of code has a different context, as those contexts diverge over time your abstractions increase in cost.