writing code top down

like learning things top down from a higher level understanding to lower level details like language constructs and apis to implement it, coding or the process of writing a computer program also involves a top down pattern which i noticed in quite a lot of places.

we start with a high level function and divide it's functionality into other helper functions who's names give a high level overview of that functionality. then we fill those helper functions out and if they have do very specific things, they can also be split further into smaller helper functions.

the idea is to divide the problem both in the head and in the code into smaller problems and approach each of those smaller problems separately. that way things become much more readable and managable. also this answers the question "what to do next" which we often face when implementing something from scratch.

this however can be confused as "write a lot of boilerplate code", no, that's not what i am saying, i am against unneccessary boilerplate and prefer to get things up and running as soon as possible.