THC does not make you a better programmer, though I suppose there could be some Balmer-peak like point of intoxication out there. I did once have an interesting insight into the my mind on drugs, though, in writing a simple TI-83+ program for use in a rangefinder my friends and I decided to build while high. The final product worked exactly correctly, but when I examined the code in a non-intoxicated state, I saw that I had used some fairly elaborate trig identities, when the most appropriate solution would have simply been the tangent.
That said, cannabis does tend to get me doing something right away, even if I dispense with the original work half the time. The sense of pure fascination is sometimes of great value.
Now the real question is whether LSD improves my math skills.