@hazelweakly@baweaver I actually keep code in my head very similarly. It tends to be very spatial. I tend to zoom in and out from micro to macro concepts. Almost akin to going from like clusters in space to galaxies to planets and back. But also a bit like a 3D graph database.
It allows me to connect concepts, topics and disparate domains of knowledge that don't normally get connected to create obscure solutions to problems.