For me it really depends on how much I smoke and what the task is. If I’m trying to learn new tech and implement something new I’m weed dosnt help. If it’s coding in a language I already know beyond the absolute basics and I smoke a reasonable amount it actual makes me feel more engaged. Of course 10 bong rips or something wouldn’t be good, but a certain amount is great once in a while. As for alchahol after about 1 beer I lose all motivation to do anything and think clearly.