Why Every Complex System Needs a Map Before It Needs Power

Kai Nguyen

Hatched by Kai Nguyen

Jun 28, 2026

9 min read

78%

0

The hidden similarity between graphs and files

What do a dependency graph and the claim that everything is a file have in common? At first glance, almost nothing. One sounds like an abstract puzzle about ordering nodes. The other sounds like a bold engineering philosophy about operating systems. Yet both are really about the same deeper problem: how to make complexity legible enough to work with.

That is the real challenge in computing. Not merely storing data, not merely executing instructions, but creating a world where relationships can be represented, traversed, and transformed without collapsing into chaos. A topological sort gives you a way to respect dependencies. The file abstraction gives you a way to unify wildly different devices and interfaces under one mental model. In both cases, the point is the same: reduce the number of shapes reality can take, so the system becomes predictable.

This is why the most powerful systems in computing often feel less like machines and more like languages. They do not just perform operations. They define what counts as an operation, what counts as a dependency, and what counts as a boundary. They turn messy reality into something you can reason about.


The deeper question: how do you act when everything depends on something else?

A dependency graph makes a simple truth visible: most work cannot begin anywhere. Some things must come first. A node with no incoming edges, a source, can be started immediately. A node with only incoming edges and no outgoing edge, a sink, is a result, an endpoint, something that can be built only after everything that feeds it exists.

That sounds technical, but it describes ordinary life with unnerving accuracy. You cannot paint a wall before you build the frame. You cannot compile a program before the code is written. You cannot understand a complex organization by looking only at its final report, because the report depends on a chain of hidden transformations.

The temptation in complex environments is to treat every task as if it were independent. That is how projects fail. You assign work in the wrong order, optimize the wrong layer, or introduce an interface before you know what it must connect to. Topological sorting is not just a graph algorithm. It is a discipline of respecting causality.

What makes this especially interesting is that abstraction is the only way humans can manage that causality at scale. The universe is full of dependencies, but we cannot hold them all in our heads. So we invent models. We say that a printer is a file, that a keyboard is a file, that a socket behaves like a file. We collapse differences into a common interface so we can operate without drowning in detail.

Abstraction is not the opposite of reality. It is how reality becomes usable.

That is the bridge between the two ideas. A topological order is an abstraction of causal structure. A file is an abstraction of interaction. Both say: there is too much complexity here, so let us preserve the essential relationships and hide the rest.


Everything is not a thing, it is an interface

The phrase “everything is a file” is often misunderstood as a slogan about similarity. It is actually a statement about uniform access. If many different resources can be read from and written to through the same small set of operations, then the system becomes radically easier to compose.

Instead of learning a new procedure for every device, you learn a few primitive actions. Instead of treating disk, terminal, network, and process communication as separate universes, you treat them as variations of the same interface. The world becomes less like a warehouse of objects and more like a set of streams passing through agreed boundaries.

This matters because complexity is not only about the number of things in a system. It is about the number of different rules required to interact with those things. A computer with ten thousand devices is manageable if they all speak a shared language. A computer with ten devices is a nightmare if each demands a bespoke protocol.

Topological sort follows the same principle in a different form. It converts a tangled web of dependencies into a linear sequence, not because the world is really linear, but because linear order is a useful interface for action. You cannot build all nodes at once. You need a sequence that respects what must come first and what can come later.

Seen this way, both ideas answer the same design question:

  1. What structure is essential?
  2. What detail can be hidden?
  3. What common operation lets us act without reconsidering the whole system every time?

Good systems are not those that remove complexity. They are those that compress complexity into stable interfaces.

Consider a kitchen. The ingredients are diverse, but the workflow is manageable because certain transformations are standardized. Wash, chop, sauté, bake, plate. You do not reinvent the rules every time you cook. That is abstraction. You also do not start plating before the oven is preheated and the dough is mixed. That is dependency management. A professional kitchen works because it knows both the interface and the order.


Sources, sinks, and the shape of mastery

There is a beautiful symmetry hiding in the graph vocabulary. A source is where action can begin. A sink is where action resolves. Between them lies the work of the system. In many domains, expertise is the ability to locate sources and sinks correctly.

A novice sees isolated tasks. An expert sees dependency structure.

This is true in software engineering, but also in writing, architecture, education, and management. When planning a product, the source might be the user constraint that everything else depends on. The sink might be the final experience the user receives. When writing an article, the source might be the core question. The sink might be the conclusion the reader reaches after the argument has unfolded. When managing a team, the source might be unclear ownership. The sink might be the delivery milestone that only becomes possible if ownership is made explicit early.

The deeper insight is that order is often more important than effort. People often ask, “How do we move faster?” The better question is, “Which dependencies are currently invisible?” Because invisible dependencies force rework. They create bottlenecks. They make teams look busy while progress stalls.

Topological sorting is valuable because it reveals a hidden truth: sometimes the hardest problem is not what to do, but what can safely be done now. That is a universal engineering problem. It appears in package managers resolving build order, in course prerequisites, in workflows that must not violate causality, and in any system where one output becomes another input.

Abstraction helps here by preventing every dependency from having to be mentally rederived from first principles. A file descriptor does not tell you everything about the device behind it, but it tells you enough to read, write, and coordinate. That is the genius of the interface: it gives you just enough information to preserve correctness while enabling action.

The best abstractions do not erase structure. They make structure portable.

That portability is what turns a one-off solution into a scalable system. Once you can treat diverse resources as files, you can write tools that work everywhere. Once you can treat dependencies as a partial order, you can automate sequencing instead of improvising it by hand.


A mental model: complexity has two currencies, structure and behavior

A useful way to unify these ideas is to think of every system as having two currencies:

  • Structure, which describes relationships, constraints, and order.
  • Behavior, which describes actions, operations, and transformations.

Topological sort is a tool for structure. It answers: what must precede what? The file abstraction is a tool for behavior. It answers: how do I interact with this thing?

When systems fail, it is often because one currency is mistaken for the other. You may have a beautiful interface but no respect for dependency order, which produces brittle automation. Or you may understand the dependency graph perfectly but expose no usable interface, which produces a system that is logically correct yet practically unusable.

The most robust designs balance both. They first map the world into a manageable structure, then expose a small set of operations that can move through that structure safely. This is why operating systems are so powerful. They do not simply manage hardware. They translate reality into a tractable sequence of actions.

If you want to see this in action, imagine a build pipeline:

  • Source code files depend on shared libraries.
  • Libraries depend on generated code.
  • Generated code depends on schema definitions.
  • Test suites depend on compiled artifacts.

A topological view tells you the order in which things must happen. The file abstraction tells you that each stage can be accessed through a common set of calls, whether it is a regular file, a device, or a pipe. Together, they let a machine organize work that would be impossible to manage manually at scale.

This is not just engineering efficiency. It is epistemology. It is about how a mind or system knows what can be done next without pretending to know everything at once.


Key Takeaways

  1. Look for dependency structure before optimizing execution. If you do not know what depends on what, speed will only amplify mistakes.
  2. Treat abstraction as a compression tool, not a simplification trick. Good abstractions preserve essential relationships while hiding irrelevant detail.
  3. Ask whether your system needs a sequence, an interface, or both. Topological ordering solves sequence. The file model solves interface. Real systems often need both.
  4. Identify sources and sinks in your own work. Find the true starting points and endpoints of a project, process, or decision chain.
  5. Prefer portable structure over local cleverness. Systems that generalize across contexts are usually built on shared interfaces and explicit dependencies.

The real lesson: power comes after legibility

We often celebrate computing as a story of raw power, faster processors, larger memory, more bandwidth, more automation. But the deeper story is more interesting. The most transformative idea in computing is not force. It is legibility.

A topological sort makes hidden order visible enough to act on. The file abstraction makes heterogeneous reality uniform enough to address. In both cases, power comes only after the world has been made readable. Without legibility, scale becomes noise. With it, complexity becomes a design material.

That is the lesson worth keeping. The best systems do not merely do more. They teach us how to think about what comes first, what can be unified, and what can safely remain hidden. They turn the world into something not simpler, but more navigable.

And once you see that, you start noticing it everywhere. The most impressive systems are not those that eliminate dependency or difference. They are the ones that make dependency and difference workable. That is the real art of computation, and perhaps the real art of intelligence itself.

Sources

← Back to Library

Hatch New Ideas with Glasp AI 🐣

Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)

Start Hatching 🐣