I've taken small doses of LSD (half a hit) with great success while coding or creating more traditional art. I find that the small dose makes it easier for me to imagine where bugs might be, visualize and compare algorithms, and consider both high level architecture ideas as well as low level details simultaneously. That said, I've only tried it a few times back in college, so I don't have many data points.
Larger doses work differently, and less directly for me. They tend to help me gain greater perspective on my life and my work. It can give me a renewed energy and excitement for what I am doing, or, conversely it can help me realize that I am on the wrong track, and will motivate me to make changes that help me live a more fulfilling life. I often end a strong experience with so much energy that I can't wait for the next day to begin so I can put into action everything I had been thinking about. I code vastly better when I have a deep understanding about why I am coding.
As with anything, these experiences have diminishing returns, so spacing them out over years has helped me keep them 'productive'.
Larger doses work differently, and less directly for me. They tend to help me gain greater perspective on my life and my work. It can give me a renewed energy and excitement for what I am doing, or, conversely it can help me realize that I am on the wrong track, and will motivate me to make changes that help me live a more fulfilling life. I often end a strong experience with so much energy that I can't wait for the next day to begin so I can put into action everything I had been thinking about. I code vastly better when I have a deep understanding about why I am coding.
As with anything, these experiences have diminishing returns, so spacing them out over years has helped me keep them 'productive'.