Often when I'm programming I'll have questions or ideas that aren't fully formed logically, but nonetheless help me find bugs or think up code design solutions.
Does anyone else have these sort of intuitive leaps when programming? How do you cultivate them, and bring them into your work more clearly?
I do this. I think this is "compiled" knowledge... in a similar way that compiled programs work but are hard to introspect, compiled knowledge is hard to articulate reasons why.
I believe compiled knowledge (or intuition) is the result of experience. As we do our work, we make mental models of the problem, then one or more solutions, then eventually come to a conclusion as to whether the solution worked out well. Your brain is capable of storing all this... if not the specific details, then at least a vague impression. Then later when you face a similar problem, and you are thinking through possible solutions, those vague impressions come back. Or perhaps stronger impressions are already top of mind. Hence, intuition.
The good news is that as I've gotten older, it has become easier to articulate the reasons in many cases. Perhaps facing similar problems enough times has refined the mental model to have more details beyond the impression.