Skip to content
0:00 / 0:00

#abstraction#coupling#dryprinciple

Abstraction Can Make Your Code Worse

CodeAesthetic

438K subscribers • 3 videos on Hallway

YouTube
  • Recommended by 3 people: 1 on Lobsters and 2 in engineering communities.
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

848K views3 years ago3 recommendations

Software designSimplicity and complexityDesign patternsRefactoring and legacy code

This video explains how adding abstraction to code introduces coupling and can often make the codebase harder to understand.

Support me on patreon.com/codeaesthetic. Access to code examples, discord, song names and more at patreon.com/codeaesthetic Adding abstraction to your code always feels like the right thing to do. But when you add abstraction, you add coupling which can often undermine the value of the abstraction. #programming #code #design #softwaredesign

Why it's here

3 people recommend this

What people say. Recommended as a great explanation of the hidden costs of abstraction and over-engineering.

u/Kurren123in r/dotnet • Recommends

On “The cure for Primitive Obsession continues!”

Sometimes, and this is a radical idea, abstraction is a bad thing. Rather than lay the code plain as it is (yes, there may be more of it this way), the user needs to think about one more thing when reading. This is one of those situations where I'd rather not be a smart develoer, and just code dirty.

u/bagofmilk1in r/dotnet • Recommends

On “DRY approach leads to bad architecture”

As with everything programming, it _depends_. There are scenarios where two pieces of code are identical, yet they represent different concepts in different contexts. What do people and rivers have in common? Well, names, for one. Should you have an `INameable` class? No, absolutely not. Abstraction can have a cost. Now let's switch to another scenario: your client asks you to add a paged table to one of the pages in your application; the paged table shows a list of products. Now, forward couple of months later, and they ask you to add another paged table in the "Manage Accounts" admin section of your app. You notice that those two tables are... very very similar in concept. You should ab…

jadoon Lobsters • Recommends

Abstraction Can Make Your Code Worse