Top-Down Approach: The right way to model software

I have been on the software industry for quite a few years now and there is one recurrent error that affects most enterprises and haunts me every night: Most developers don't understand how to model their software correctly.

I’m not talking about using crazy bureaucratic diagrams, the ones you do once in a lifetime, forget about it and when you need it it’s too late. Your software grew 10x what it used to be and you’re faced with a useless piece of paper/file you have to throw away. I’m talking about a soft skill that can change your life! (seriously, no kidding)

Imagine a tall tower full of floors and happy people living inside it. On the lower floors you have the poorer, most humble people. Every night they hear the noises of the streets and their jobs are mainly manual work. On the higher floors you have their bosses, who delegate work to them and hear no street noise, because the tower is very tall and their windows are far away from the noisy streets. When a programmer focuses on software development, it is fundamental that he/she sees the different levels of abstraction of the software he is willing to develop.

Spoiler alert: this is a software modelling metaphor

This "tower of abstractions" represents software development almost flawlessly. The lower floors are the libraries that deal with low-level work. They hear lots of noises because they deal with dirty work (sockets, I/O, memory, etc). The higher levels are the libraries that use the "lower floors" extending the power they bring in a much more controlled way. Have you ever thought that every time you allocate memory with a "simple" new or malloc keyword, you're on the top-level of a huge tower of abstraction? A humble memory allocation function call triggers lower level OS memory management functions until they reach the metal.

Graphic representation of the malloc tower of abstractions on HelenOS


It is fundamental for a developer to understand that if he/she can visualize a tree of function calls, it probably means that they used a top-down approach to solve the problem, and that is the most clean and logical way to solve a problem or write an algorithm.

Every time you face a complex problem think about a tree. Not only in your career as a developer, but also as a problem solver. The top-down approach will definitely help you.

Amazonian • Hacker • Former CTO at InvestPro • Cloud solutions expert • Enterprise Architect • Loves his wife, family and maths.

Amazonian • Hacker • Former CTO at InvestPro • Cloud solutions expert • Enterprise Architect • Loves his wife, family and maths.