So many non-heads talkin’ in detail about what they’ve never even experienced. I just had to come put a stop to this, no matter how old this thread is 
The reality of it is that it’s totally subjective and unique for different people. You may be able to harness benefits, but there are no guarantees: the plant is known to have widely varying effects on different people. It makes some people feel sick. Others feel relaxed and zoned-out. Others enjoy pain relief. Others think at a mile-a-minute and come up with creative ideas that are genius, and also many ideas that are silly or dumb. As it has been mentioned, different strains/breeds of the plants have tendencies towards different effects.
So I can only tell you about my personal experiences with cannabis and various mental tasks.
It has mental pros and cons, for sure.
Being high is a weird and seemingly contradictory mixture of being highly focused, and easily having your focus totally derailed. It’s almost like I become too focused on one mental concept, which causes me to suddenly lose context for how that concept fits into the greater situation, which causes me to focus too hard on trying to regain that context, and causes me to lose track of the concept again. That can certainly hamper my ability to code, which often involves a lot of broad oversight of many moving parts.
On the other hand, there are times where I was working on some tough mathematical algorithms, which I couldn’t quite grasp the solution for when I was sober, but getting high allowed me to separate myself from my mental block, see the problem from a new perspective, and come up with an efficient solution that I could barely grasp when I was sober again. So long as it passed unit tests, I moved on 
There have been times like that where I really believe my use of cannabis improved my ability to get past a particular mental block and solve an abstract problem I was having difficulty with.
When playing video games, where having a one-track focused mind can be dominating, and not much broad oversight is required, I find that it gives me a very calm and controlled form of extreme focus, where my reaction times can be better than ever. Sometimes it really feels like I’m playing the game in slow motion compared to everyone else, and have a huge edge in shooting them first. The results are quantitative, too: kill to death ratios don’t lie 
So, all of this being said:
I do enjoy getting high to have fun and play video games, but I generally don’t enjoy getting high when I’ve gotta grind out quality code. In occasional circumstances while programming, I partake to both take a mentally relaxing break, and sometimes to have a crack at solving a problem I’ve developed a mental block for.
Because of pot’s affect on memory, I think it would be mostly cons for trying to learn and absorb new information. I try to avoid getting high when I’m actually trying to remember new information.