Tuesday, August 14, 2018

Layers of Abstractions

Code often compiles to an intermediate language. Intermediate languages are generally compiled into machine-language. Machine-language is really just bits. Bits are really just groups of electric, magnetic, reflective, mechanical, or similar potentials.

An integer isn't really an integer except in our heads. It's just some electrical potentials marching around through microscopic semiconductors.

We imagine that a certain combination of voltages spread across some data lines mean "seven" and that the absence of those voltages plus some voltage on an adjacent line means "eight". More precisely, we assign those meanings.

Similarly, programming languages and source code are about us, not computers. They are about allowing humans to express and interpret ideas.

Those abstractions are transformed into something that drives a machine. It's a machine that acts quickly because the energies are delicate, the resistances are small, and the distances are short but it is a machine nonetheless.

The machine transforms some data and expresses it in a way that we can match to another set of abstractions.

These abstractions are arranged in layers. A date is built atop an integer. An integer is based on combinations of bits and the relationships between those combinations.

We assemble smaller concepts and unify them behind larger abstractions, repeating all the way up until we have, say, an Android app or a RESTful service.

Finding abstractions isn't the most important part of software development because there are other parts that re less important. It's the most important because it is so pervasive.

Everything you do as a software developer, from writing a test to defining an installer, absolutely depends on your ability to identify and express abstractions.