I've heard the phrase "Think high, work sober" and I basically agree with the premise. I don't smoke when I have a deadline, but sometimes I like to change my perspective and mind-space sometimes. Mostly I had really good ideas about coding (or solving problems/bugs in a much different way) when I smoked weed.
Have you ever coded while being high? What was the result?