Abstraction: How to tame complexity and boost productivity

05.09.2013 Jordan West

Engineers generally think of abstraction as a syntactical construct that helps write code, but the concept of abstraction goes beyond just code, and is incredibly powerful for building anything faster, better and cheaper.

Abstraction allows our feeble human minds to comprehend complexities by cutting out all the low level stuff. When we say “I’m going to pick up some milk”, we don’t say “I’m going to move my legs to carry my body toward the car and use my hand to open the door and insert a key and turn it and…”. We abstract away the information that we don’t need to know.

This practice seems obvious. But the benefits of this approach applied to any engineering discipline are immense. Abstracting away complex functionality means that functionality is reusable, and people without specialist knowledge can take advantage of that functionality. It means engineers can build up powerful components and quickly pull together what is required.

Pick up your smartphone. In your hands you’re holding hundreds of thousands of collective man-years of innovation by scientists and engineers. These days a typical smartphone contains a pretty powerful computer chip. That chip alone is the result of everything from theoretical quantum mechanics to Newton’s laws of motion, and everybody from Einstein to the guy that greases machines every day.

The whole process is a ridiculously incomprehensibly huge and complex series of events. But here’s where things get really meta. Inside these chips we’re talking about billions of semiconductors, 22 nanometres wide (5000x thinner than a human hair). Other than Gary with his microscope and ridiculously steady hands, the only way to produce these chips is with a machine controlled by a chip. The machine that produced the chip in your smartphone uses a chip that was produced by a machine that uses a chip that was produced by a machine that uses a chip...

As a smartphone manufacturer, you don’t really care what’s inside the chip. You just care that the chip does what it says it does. You care that it will work with your other bits and pieces. You carefully choose the bits and pieces to work together. Likewise, the user of the smartphone doesn’t care what’s inside – they just care that they can smear their finger over the screen and chop up virtual fruit.

Putting abstraction to work in practice requires more than just knowing how to use class constructs in a programming language. Here are a few guidelines we follow at Exigen to take advantage of abstraction.

1. Take the time and effort to think through the design properly and reap the benefits later.

Abstraction isn’t easy – deciding where to draw the line for a set of functionality or data is difficult and there are many competing philosophies on the best approach. However this process is an integral element of design. If left out, a design inevitably ends up becoming a tangled mess that is more expensive to maintain, and harder to optimise and change. Make the extra effort in the beginning and it will pay off in the long run.

2. Make the effort to provide users with a nice interface, even if you are the only user.

When building an interface for user interaction, engineers hopefully take care to ensure users can understand and use their system. But beneath the interface, the design is often anything from spaghetti code to tidy and modular. Take the user interface paradigm and apply it to every level of functionality, treating everything using your functionality as a ‘user’.

3. Avoid exposing implementation specifics to higher levels.

Keeping functionality modular means ensuring higher levels of functionality can swap out your implementation for a different implementation. This means that where possible you avoid exposing any details specific to your implementation to users of your implementation. This means if in the future a better implementation is developed, it can be swapped in with minimal changes to higher level code. This is the reason operating systems that were developed 5 years ago can run on computers that are built tomorrow.

One of the most common reasons clients reach out to us is that the hardware running their systems has suddenly become unavailable or unsupported, leaving them exposed to huge risk. We often discover that their systems have been developed with deep integration into proprietary hardware, making it prohibitively expensive to swap out the hardware. Building a layer of abstraction brings with it the advantage of cutting these deep ties, significantly reducing the cost of replacing hardware or modifying software.

Complex systems can do incredible things in this day and age, but in the end they are all designed by humans, with all of our limitations. Without understanding the concept of abstraction, the human race would not be where it is today. In fact, abstraction goes right to the core of life – to the cells in our body. Take advantage of this powerful concept to do more with less, and build systems that are more resilient into the future.