I find it's great for diving into refactoring projects that I've been putting off. I like to do that stoned because it's usually not that hard, just tedious moving files around and organizing things. Same way my wife reorganizes the furniture when she gets stoned.
I also sometimes find solutions to hard problems in my head when stoned, though I usually just write down the solution rather than coding it, as large-scale implementations are better done sober.
Personally, weed might help in the creative phase of problem solving, but if it requires working memory weed is a big negative(at least how it affects me)
Yeah, a former colleague of mine told me they used to regularly drink a pint of beer with an evening of coding, until on one occasion they introduced a subtle bug which took them two days to hunt down.
They were working in C, which makes it a lot easier to introduce subtle bugs than most languages, but I certainly think twice about coding while under the influence since I heard that story!