The Programmer's Relationship With Abstraction

The Programmer's Relationship With Abstraction

●2 ●37 ●92
calendar_today • schedule15 min read

There is a strange moment in every programmer's life when code stops looking like code.

At the beginning, programming feels almost physical.

You write a variable.

You call a function.

You create a loop.

You store something in a database.

You send a request to an API.

You render something on a screen.

Everything is close to the machine.

Then, slowly, something changes.

You stop thinking about individual instructions and start thinking about systems.

Instead of thinking about a database query, you think about a repository.

Instead of thinking about an HTTP request, you think about a service.

Instead of thinking about individual objects, you think about domains.

Instead of thinking about files, you think about modules.

Instead of thinking about individual servers, you think about infrastructure.

And eventually, you might find yourself designing something that does not resemble the original machine-level problem at all.

This is the programmer's relationship with abstraction.

Abstraction is not simply a programming technique.

It is a way of thinking.

It is the process of deciding what deserves attention and what can temporarily disappear from our mental model.

And that makes abstraction one of the most powerful ideas in software engineering.

But abstraction is also one of the easiest things to misunderstand.

Too little abstraction can make software difficult to evolve.

Too much abstraction can make software difficult to understand.

The interesting part is finding the boundary.

That boundary changes as the system changes.

And perhaps more importantly, it changes as the programmer changes.


Programming Begins Close to Reality

A beginner often writes code that directly represents the problem.

Imagine building a simple shopping application.

You might begin with something like:

product_name = "Keyboard"
price = 50
quantity = 2

total = price * quantity

There is almost no distance between the problem and the code.

A keyboard costs 50.

The customer wants two.

The total is 100.

This is useful because the program is easy to mentally simulate.

The programmer can see almost everything.

But real software rarely remains this simple.

Soon, there are hundreds of products.

Then multiple customers.

Then shopping carts.

Then discounts.

Then taxes.

Then payment methods.

Then refunds.

Then inventory.

Then shipping.

Then notifications.

Then analytics.

The original calculation has become a small part of a much larger system.

At this point, writing everything directly becomes difficult.

We need abstraction.

We might introduce:

class Cart:
    def add_item(self, product, quantity):
        ...

Now the programmer no longer needs to think about every arithmetic operation whenever an item is added.

The concept of "adding an item to a cart" becomes an abstraction.

That abstraction gives the programmer a larger unit of thought.

This is one of the fundamental powers of software.

We can build new ideas out of previous ideas.


Abstraction Is Mental Compression

One way to understand abstraction is as mental compression.

Consider the word:

database

A programmer can say "database" without mentally visualizing every disk operation, memory page, index lookup, lock, transaction, network packet, and storage engine involved.

The word compresses an enormous amount of complexity.

The same thing happens with:

  • API
  • function
  • class
  • queue
  • cache
  • operating system
  • container
  • framework
  • compiler
  • service
  • event
  • transaction
  • authentication
  • deployment

Each concept hides a large amount of implementation detail.

This allows programmers to operate at higher levels.

Imagine if every time you used a web browser you had to understand TCP packet retransmission.

Imagine if every time you created a database record you had to understand filesystem blocks.

Imagine if every time you rendered a user interface you had to manually manage every pixel.

Modern software would be almost impossible to build.

Abstraction allows one layer of technology to become the foundation for another.

The operating system abstracts hardware.

Programming languages abstract machine instructions.

Frameworks abstract repetitive application patterns.

Libraries abstract algorithms.

APIs abstract services.

Applications abstract complicated workflows into simple interactions.

The entire software ecosystem is built from layers of abstraction.


The First Relationship: Using Abstractions

The first stage of a programmer's relationship with abstraction is learning to use it.

You discover libraries.

You discover frameworks.

You discover APIs.

You discover data structures.

You discover design patterns.

You learn that you don't have to build everything yourself.

Need authentication?

There are libraries.

Need HTTP communication?

There are clients.

Need database access?

There are drivers and ORMs.

Need image processing?

There are libraries.

Need machine learning?

There are frameworks.

The programmer begins to climb upward.

Instead of asking:

How do I implement everything?

The question becomes:

What existing abstraction can I use?

This is an important transition.

Programming becomes less about writing every possible operation and more about composing existing capabilities.

But there is a trap here.

Using abstractions without understanding them can create fragile systems.

You might know how to call an ORM method without understanding what SQL it produces.

You might know how to configure a framework without understanding the lifecycle underneath it.

You might know how to deploy a container without understanding the networking around it.

This doesn't mean you must understand every internal implementation.

That would defeat the purpose of abstraction.

But you need enough understanding to know where the abstraction ends.


The Second Relationship: Understanding Abstractions

Eventually, a programmer encounters a problem that the abstraction does not solve.

The database query becomes slow.

The framework behaves unexpectedly.

The API produces surprising results.

The cache returns stale information.

The asynchronous operation behaves differently under load.

Now the programmer has to look underneath.

This is where abstraction becomes interesting.

A good programmer needs two perspectives.

The first perspective is:

What does this abstraction allow me to do?

The second is:

What is actually happening underneath it?

These perspectives are not contradictory.

They complement each other.

You can use a high-level abstraction while still understanding the lower-level mechanism when necessary.

For example, a programmer might normally interact with a database through an ORM.

That is perfectly reasonable.

But when a performance problem appears, understanding SQL, indexes, query planning, transactions, and database storage becomes extremely useful.

The abstraction remains valuable.

The deeper knowledge simply becomes available when needed.

This is one of the healthiest relationships with abstraction.

Use the abstraction.

Understand enough of the underlying system to reason about it.

Descend when necessary.

Return to the higher level when the problem is solved.


The Abstraction Ladder

Software can be viewed as a ladder.

At the bottom are physical resources.

CPU.

Memory.

Storage.

Network interfaces.

Electrical signals.

Above that are machine instructions.

Then operating systems.

Then programming languages.

Then libraries.

Then frameworks.

Then applications.

Then business workflows.

Then user experiences.

A programmer can move up and down this ladder.

Consider a simple button click.

At the user level:

The user clicked "Buy."

At the application level:

The checkout process started.

At the service level:

An order creation request was sent.

At the API level:

A POST request was received.

At the database level:

A transaction inserted an order record.

At the operating-system level:

Processes and network resources were involved.

At the hardware level:

Instructions were executed by the processor.

All of these descriptions can refer to the same event.

The difference is abstraction level.

The programmer's skill is partly knowing which level is appropriate for the problem.

If you are designing a checkout experience, thinking about CPU instructions may be unnecessary.

If you are debugging a compiler, thinking about button colors may be irrelevant.

The right abstraction level depends on the question.


The Danger of Leaking Abstractions

Abstractions are supposed to hide complexity.

But sometimes the complexity escapes.

This is called an abstraction leak.

Imagine an application using an ORM.

The programmer thinks:

users = User.objects.filter(active=True)

The abstraction makes database access feel like ordinary application code.

But then the application becomes slow.

The programmer discovers that the query is executed thousands of times.

The ORM abstraction did not eliminate the database.

It merely provided a different interface to it.

The database still exists.

Network latency still exists.

Indexes still exist.

Transactions still exist.

Storage constraints still exist.

This is why abstraction should not be confused with elimination.

An abstraction hides complexity from ordinary interactions.

It does not make that complexity disappear.

The physical world still exists underneath the software.

Networks still have latency.

Memory is finite.

Storage has limits.

Computers still execute instructions.

Systems still fail.

Understanding this gives programmers a more realistic relationship with abstractions.


The Abstraction Tax

Every abstraction has a cost.

Sometimes that cost is computational.

Sometimes it is conceptual.

Sometimes it is organizational.

Imagine creating a simple function:

def calculate_total(price, quantity):
    return price * quantity

Then imagine turning it into:

PricingCalculationCoordinator
    -> PricingStrategyResolver
        -> PricingProviderFactory
            -> PricingCalculationService
                -> PricingEngine
                    -> PricingRuleAdapter

Technically, this might be possible.

But the abstraction has become larger than the problem.

This is where abstraction becomes counterproductive.

Every additional layer introduces another concept.

Every concept creates another thing a programmer must understand.

This is an abstraction tax.

The software may become more flexible.

But flexibility has a cost.

More interfaces.

More files.

More names.

More relationships.

More places to debug.

More mental overhead.

Good architecture is not about maximizing abstraction.

It is about creating useful boundaries.


The Abstraction Trap

Programmers sometimes discover a powerful abstraction and start applying it everywhere.

Everything becomes a pattern.

Everything becomes a service.

Everything becomes an interface.

Everything becomes configurable.

Everything becomes generic.

The code may look sophisticated.

But sophistication is not the same thing as clarity.

Suppose you have three classes that perform slightly different operations.

You could immediately create a generic framework for them.

But perhaps those three classes will never share behavior.

The abstraction might be premature.

A little duplication can sometimes be easier to understand than a complicated generalization.

This leads to an important principle:

Do not abstract merely because you can.

Abstract when the abstraction creates a meaningful improvement.

Perhaps it removes repeated complexity.

Perhaps it establishes an important boundary.

Perhaps it protects a volatile implementation.

Perhaps it creates a reusable capability.

Perhaps it allows different parts of the system to evolve independently.

The reason matters.


Abstraction and Time

One of the most interesting aspects of abstraction is that its usefulness changes over time.

An abstraction that makes sense today might not make sense tomorrow.

A small application may start with a simple database module.

Later, it becomes a large platform.

The original database boundary might no longer be appropriate.

Likewise, a complicated abstraction might eventually become unnecessary.

Technology changes.

Requirements change.

Teams change.

Traffic changes.

Products change.

Therefore, abstractions should not be treated as permanent monuments.

They are tools.

Tools can be replaced.

A programmer who treats architecture as immutable can accidentally turn yesterday's solution into today's constraint.

Good software evolves.

Good abstractions evolve with it.


Abstraction and Naming

One of the most underrated parts of abstraction is naming.

A good abstraction gives a complicated collection of operations a meaningful name.

Consider:

process_transaction()

This tells us something.

Now imagine:

execute()

The second name is technically simpler.

But it carries less information.

Good abstraction is not simply about hiding details.

It is also about communicating concepts.

Names become handles for thought.

When you say:

Authentication service

the team can discuss a concept.

When you say:

Inventory reservation

the team can reason about a workflow.

When you say:

Event processing pipeline

the team can discuss a system boundary.

The abstraction gives the team vocabulary.

This is why architecture and language are deeply connected.

Software is not only written with syntax.

It is also written with concepts.


Abstraction Creates New Possibilities

There is another side of abstraction that is even more fascinating.

Abstraction does not only hide complexity.

It creates new possibilities.

Once programmers have a function, they can compose functions.

Once they have objects, they can compose objects.

Once they have APIs, they can compose services.

Once they have distributed systems, they can build platforms.

Once they have machine learning frameworks, they can build intelligent applications without implementing every mathematical operation from scratch.

The higher layer becomes a new building block.

This is how technological ecosystems grow.

One abstraction becomes the foundation for another.

The programmer does not have to restart from zero.

They inherit an entire stack of previous ideas.

That is one of the reasons software can move so quickly.

We are standing on layers of abstractions created by previous engineers.


The Programmer as an Abstraction Designer

Eventually, a programmer stops merely consuming abstractions.

They start creating them.

A function is an abstraction.

A library is an abstraction.

An API is an abstraction.

A framework is an abstraction.

A service boundary is an abstraction.

A programming language is an abstraction.

Every reusable piece of software is, in some sense, a decision about what other programmers should not have to think about.

This creates an important responsibility.

When designing an abstraction, you are designing another programmer's future experience.

You are deciding:

  • What should be visible?
  • What should be hidden?
  • What should be configurable?
  • What should be fixed?
  • What should happen when something fails?
  • What assumptions should exist?
  • What should the interface communicate?
  • How much knowledge should users of the abstraction need?

This is software design at a deeper level.

You are not simply designing code.

You are designing the boundary through which other people will understand your code.


The Best Abstractions Feel Natural

A strong abstraction often disappears.

Think about opening a file.

You don't normally think about the physical storage mechanism.

You think:

open("notes.txt")

That is an extraordinary amount of abstraction.

Behind that small operation are operating-system calls, filesystem structures, permissions, storage devices, memory buffers, and many other mechanisms.

But the interface feels natural.

That is the magic of good abstraction.

It compresses complexity without forcing the user to constantly think about the compression.

The abstraction becomes intuitive.

It becomes part of the programmer's vocabulary.

Eventually, the programmer stops noticing it.

That is often a sign that the abstraction is doing its job.


But Sometimes We Need to Break the Abstraction

There are moments when the right engineering decision is to bypass a layer.

Perhaps the ORM is insufficient for a complicated query.

Perhaps the framework does not expose a required operating-system feature.

Perhaps a high-level networking library introduces unnecessary overhead.

Perhaps a generic data structure is not appropriate for a specialized workload.

This does not mean the abstraction was bad.

It means the problem requires a different level of control.

A mature programmer should be comfortable moving between abstraction levels.

You should be able to write high-level application logic.

Then investigate lower-level behavior.

Then return to high-level design.

The goal is not to live at the lowest level.

The goal is to understand enough levels to make good decisions.


Abstraction and Artificial Intelligence

Modern programming introduces another interesting layer of abstraction.

AI-assisted development can generate code, explain APIs, produce tests, suggest architectures, and translate ideas into implementation.

This creates another abstraction boundary.

Instead of manually writing every implementation detail, a programmer can describe an intention and receive a possible implementation.

But the fundamental relationship remains the same.

The programmer still needs to understand the abstraction.

A generated function is still an abstraction.

A generated architecture is still an abstraction.

A generated API integration still depends on real systems underneath.

The programmer's role increasingly involves understanding what the generated layers mean, how they interact, and where their assumptions live.

In that sense, the future of programming may involve even more abstraction rather than less.

The interesting question becomes:

Which details should humans think about, and which details can safely be delegated to machines?

That is an engineering question.

And it will continue evolving.


The Art of Choosing the Right Distance

Perhaps the deepest skill in abstraction is choosing distance.

Too close to the machine, and everything becomes complicated.

Too far from the machine, and important realities become invisible.

The programmer constantly adjusts this distance.

When designing a user interface:

Think in terms of users.

When designing business logic:

Think in terms of domain concepts.

When designing services:

Think in terms of boundaries and communication.

When optimizing a database:

Think in terms of queries, indexes, transactions, and storage.

When optimizing a program:

Think in terms of memory, CPU, algorithms, and data movement.

When debugging hardware interaction:

Think much closer to the machine.

The question is never simply:

What is the highest level?

The better question is:

What level helps me understand this problem?

That is the essence of abstraction.


Software Architecture Is Abstraction Management

Architecture can be viewed as the management of abstractions.

A large system contains thousands of concepts.

The architecture determines how those concepts are grouped.

Where are the boundaries?

Which components communicate?

Which details are private?

Which interfaces are public?

Which dependencies are allowed?

Which systems can change independently?

Which concepts belong together?

These decisions determine how easily programmers can reason about the system.

Good architecture creates useful mental boundaries.

You can understand one component without understanding the entire system.

That is an enormous productivity advantage.

A programmer should be able to open a module and understand what it does without mentally loading the entire universe.

Abstraction creates that possibility.


The Personal Evolution of a Programmer

The relationship with abstraction also describes the evolution of the programmer.

At first:

What does this line of code do?

Then:

What does this function do?

Then:

What does this module do?

Then:

How do these services interact?

Then:

What is the domain model?

Then:

What assumptions does this architecture make?

Eventually:

What mental model does this entire system give its developers?

The programmer's field of vision expands.

They stop seeing isolated instructions.

They begin seeing relationships.

They recognize patterns.

They notice boundaries.

They think in systems.

But experienced programmers also learn something important:

Not every problem needs a sophisticated abstraction.

Sometimes the best solution is a small function.

Sometimes it is a simple database table.

Sometimes it is a straightforward loop.

Sometimes it is a carefully designed architecture spanning multiple systems.

Engineering maturity is partly the ability to tell the difference.


Abstraction Is Not About Hiding Everything

It is tempting to define abstraction as hiding implementation details.

That is only part of the story.

Abstraction is also about exposing the right concept.

A good abstraction hides unnecessary information while preserving useful information.

For example, a payment API should not require the caller to understand every internal database operation.

But it should expose useful concepts such as:

create_payment()
get_payment()
refund_payment()

The internal details are hidden.

The important capabilities remain visible.

Therefore, abstraction is not about maximum hiding.

It is about meaningful exposure.

The interface should communicate what matters.


The Programmer's Responsibility

Every abstraction introduces assumptions.

A queue assumes something about message delivery.

A cache assumes something about data freshness.

A transaction assumes something about atomicity.

An API assumes something about communication.

A framework assumes something about application structure.

A library assumes something about its environment.

A programmer who uses abstractions responsibly learns those assumptions.

Not every detail needs to be memorized.

But the important constraints need to be understood.

This is why documentation, source code, experimentation, profiling, testing, and debugging remain valuable.

Sometimes the fastest way to understand an abstraction is to use it.

Sometimes it is to read its documentation.

Sometimes it is to inspect its implementation.

Sometimes it is to measure its behavior.

The method depends on the problem.


The Future Will Have More Layers

Software will continue becoming more abstract.

We already work with cloud infrastructure instead of individual physical machines.

We work with managed databases instead of manually maintaining storage systems.

We work with APIs instead of implementing every capability ourselves.

We work with high-level languages instead of assembly.

We work with frameworks instead of rebuilding common infrastructure.

We increasingly work with AI systems that themselves operate across layers of abstraction.

This does not make lower-level knowledge irrelevant.

It makes understanding boundaries even more important.

The more layers we build, the more carefully we need to understand how those layers connect.

A programmer may spend most of the day at a high level and occasionally descend several layers to solve one critical problem.

That ability to move is powerful.


Final Thoughts

The programmer's relationship with abstraction is not a story about moving away from complexity.

It is a story about learning how to manage complexity.

At the beginning, we see instructions.

Then functions.

Then modules.

Then systems.

Then platforms.

Then ecosystems.

Every layer gives us a new way to think.

But every layer also creates new assumptions.

The best programmers are not necessarily the ones who use the most abstractions.

They are the ones who understand why an abstraction exists, what it hides, what it exposes, where it breaks, and when it should be replaced.

Sometimes we need to go higher.

Sometimes we need to go lower.

Sometimes we need a new layer.

Sometimes we need to remove one.

Programming is the constant movement between these perspectives.

Perhaps that is what makes software engineering so interesting.

A computer ultimately executes very simple operations.

Yet humans can construct enormous conceptual worlds on top of them.

A function becomes a service.

A service becomes a platform.

A platform becomes an ecosystem.

An ecosystem becomes a new abstraction for someone else.

And then another programmer comes along and builds something even larger.

That is the relationship.

We abstract so that we can think bigger.

We understand the layers underneath so that we do not lose contact with reality.

And somewhere between those two directions is the craft of programming.

Software is built from abstractions, but engineering is the art of knowing which abstractions deserve to exist.

Want more #programming & #softwareengineering deep dives?

Join 6,110+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

Merancang Backend Bisnis ISP: API Pelanggan, Paket Internet, Invoice, dan Tiket Support

Masbadar - Mar 13

The Zero-Net-Loss Fleet & The Mercenary Squad: A Live AI Economy

DEVPlank - Aug 4

How AI Is Changing Web Development, and What Developers Still Need to Understand

Daniel Decker - Nov 10

TypeScript Complexity Has Finally Reached the Point of Total Absurdity

Karol Modelski - Apr 23

Frameworks Are Institutional Memory

Ken W. Algerverified - Sep 17
chevron_left
2.5k Points • 131 Badges
Kapiri Mposhi, Zambia. • zambianmillenial.com
56Posts
11Comments
408Connections
Derek Mwale — Where Code Meets Creativity.

Commenters (This Week)

1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!