One of the many benefits of having a 3 year old son is that you can, without any shame say you spent the night building lego... most of the time with my son.
But tonight when building a lego bus... with my son... that he wanted, I had the realisation how similar it is to coding.
The  joy of building something new, testing out new ideas, getting better with practise, how different pieces fit together..

And just as in coding you sometimes build a piece and halfway through you get a new idea about how that section could be better in “the implementation”, and you have to take a few steps back and tear down some of the pieces that you built, only to build it up again using slightly different parts or using a different technique in order to get something that you feel is better.

And just like in coding, you can build “freestyle”, but if you don't plan ahead very far (or at all) chances are higher that you are going to have to tear down larger sections of what you just built since you didn’t anticipate the problems that could arise and where you were going.

And  if you have an idea about basically anything, then you can build it with enough time and patience.

There is even common design patterns when building lego that you learn over time as well: How to build a chassi for a car, how to build a solid wall and so on.

The things you build can be a monolithic piece of software/lego, or you can build modules/objects that you fit together afterwards:
Here is the chassi for the truck, here is the driver’s cabin, heres the loading platform, and lets put them together now. You can even switch out the different modules later on if you build something better or more interesting.

In order to be really good you have to know what pieces you have at your disposal and how they can be used, just like when you learn a new programing language and all the libraries and API:s available.

And if you’re really unlucky you “customer” changes his mind halfway through the build and decides he doesn’t want a bus, but a car instead...