I would imagine that most architects and drafters can't imagine the entire building they are creating either. But that doesn't stop them from doing it.
Try to remember that programming is really a translation of an idea into machine language. The first thing i try to do is imagine and write down what it is i want to do:
I want to have a box that rotates.
then I try to imagine and write down the steps that are involved:
Intialize a window
intialize a system to draw objects
create a cube
draw the cube
I then break down each step into more involved parts. The pattern here is to start with a simple idea and progressivly make it more detailed, before you wirte a single peice of code.
The more pedesign you do the easier it is to write your code. I cannot emphasize this point enough. Great buildings are designed before they are built, and are not trial and errors. Architects don't stand at the site and direct where to put each support, only to change their mind if it doesn't work. If you write code by trial and error, your systems will be small and trivial. But if you can learn to design your code before you start to program, you soon realize that you debug less, create more intersting and thoughtful programs, and it will be less stressful and more fun.
BTW, people who write code using one letter variables write code that is usually hard to read, difficult to debug, and probably took a long time to write. Try using more meangingful names when designing your code. It will make debugging less difficult, it communicates to the human much easier, and is easier to read by more people.