This is an interesting anecdote. I have gotten high several times during my college years and less so since I started my career. In all of the cases I got high, it was primarily for entertainment purposes. However, whenever I am high, I get some sense of clarity about problems that were irking me the week before (I usually do weed over the weekends). This led me to wonder, esp. lately, what if there is actually some connection between productivity and marijuana use (not abuse) and your experience seems to be inline with that. Ofcourse, there are trove of other anecdotes about how weed is used for creative/artistic purposes but I haven't come across ones related to programming.