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'.
Here's another reported success: "Use of LSD-25 for Computer Programming" by Dennis R. Wier http://www.maps.org/news-letters/v18n1/v18n1-MAPS_24.pdf (Previously on HN: http://news.ycombinator.com/item?id=654168 )
I've given dex to other programmers on occasion; they're often amazed at how much it helps them concentrate and get things done.
It's kind of like coffee that WORKS.
Hence my favourite programming beverage: grind your beans, sprinkle finely powdered amphetamine on the top of the basket, and make yourself a nice motherfuckiato.
That's mighty addictive stuff, for someone with the wrong combination of genetics and psychology, this could be really bad.
The drug war is full of nonsense - but amphetamines are regulated for a good reason.
There are creative aspects to programming, and you might gain some insights that are applicable, but I'd save the implementation till you come down unless the dose was rather small.