r/AskProgramming • u/hamburglin • Jun 15 '21
Other I programmed while really high on weed and it forced me to use my brain like a Stack?
I chose to post this here because I do not know of any other popular programming subreddits that allow text posts (what a shame how embarrassing that fact is...)
I tried to code while really high as an experiment. I struggled terribly for about 30 minutes or so while I was coming to terms with the insanely low focus and short term memory I was dealing with.
After about 15 minutes of mindfulness meditation I started pushing away the ADHD random thoughts (that were 4x worse because of being high) and could find pockets of time to focus on some things for short periods of time. However my short term memory was still shot. I couldn't hold together multiple object ideas and relationships for more than what felt like a few seconds. Every new thing I'd think of, I'd lose the original idea. How was I supposed to remember what I was fixing and why?
So what I ended up doing was pointing myself to a new code addition or problem for a small refactor I was working on. Then, if I ran into another problem that needed to be fixed because of what I was currently working on (and only because of this, very important) I went straight to that instead and gave myself a small comment reminder pointing back to the code I just came from.
It was really scary because I really did lose track of what was in the stack, but I never lost track of current task or pointer back to what brought me there.
All said and done, I created two new classes, moved some code out of an old class to a new one, cleaned up annoying new bugs that appeared due to the new functionality and more!
I was really surprised it worked but also terrified that I'd lose focus before I closed out the stack. That took real focus power.
This experiment reminded me that it's so much easier to white board bigger changes out first so you don't get lost, and to get rid of tightly coupled code architecture that you're going to forget needs updating later (and won't remember to put on your whiteboard). What that type of code does it forces you to work on multiple issues for the same stack level at the same time and is easy to get lost.
Edit: I think people are assuming some things so I'll clarify:
No, I'm not new to weed
No I've never been able to work when extremely high before due to it ruining my focus and memory
Yes, I'm sharing a strategy to work while really high that I don't think everyone knows about and was wondering if others have done something similar.
No, I don't recommend this. I think getting really high on weed helps more with being creative than logical, but it depends on how much you take.
10
Jun 15 '21
ha what? there are plenty programming subs that allow text posts.....
3
u/Poddster Jun 15 '21
/r/programmingcirclejerk allows them. I think this post would do well over there.
1
-6
u/hamburglin Jun 15 '21
Programming and coding doesn't. Are there popular ones that do?
1
Jun 15 '21
sure there are tons of language specific ones. there is one for freecodecamp. there is one for ADHD programmers there is a software development one. cscareerquestions, experienceddevs, there are subs for programming language design and comp sci specifically. in other words, there are a shit ton
-7
u/hamburglin Jun 15 '21 edited Jun 15 '21
Wow. How am I supposed to reach a large audience when they are all split like that? And how am I supposed to identify one quickly?
0
3
Jun 15 '21
I can relate to this so much that I could’ve written this post. Lately I’ve been hitting it a bit too much though, and it’s become a big handicap for me so I’ve started a break. It’s a bit frustrating how slowly its leaving my body though and it’s reminding me that moderation is key.
1
u/hamburglin Jun 15 '21 edited Jun 15 '21
Interesting. Do you have ADHD? I'm now wondering just how bad the weed focus and memory issues are in people with ADHD vs people without it.
2
3
u/pm_your_unique_hobby Jun 15 '21
I wrote my first code on acid. Before then for some reason I couldn't escape tutorials hell
3
u/hamburglin Jun 15 '21
Ha, would love to hear how that went down!
2
u/pm_your_unique_hobby Jun 16 '21
I dropped w my friend scott. We were chillin at my spot. I moved my mattress to the floor of my living room and wrote a bash script (which i didnt even know bash existed previously) that calls youtube-dl. All i had done to that point were python 3 tutorials
9
u/D3LB0Y Jun 15 '21
Stoned coder? No, you’re the first
2
u/hamburglin Jun 15 '21
Didn't say I was the first, but it's the first time I was able to work while really high.
6
u/D3LB0Y Jun 15 '21
I’m just winding you up man; you do you, just please review the code sober as we’re not as good as we think we are
1
u/hamburglin Jun 15 '21
Heh np. I'm actually deathly afraid of reviewing it... I don't tend to retain things long term when I smoke which is why I usually avoid it when working.
Can't wait for the surprises in store...!
I will say, some of the code just looked really good. Like, the actual shapes of the letters and the words they made were pleasing.
1
u/tylercamp Jun 18 '21
Any updates?
1
u/hamburglin Jun 18 '21
The code itself was actually fine. The actual problem is that I didn't consider (wasn't able to) the big picture of my overall code architecture as much and I need to revisit the functionality I want in the 3 classes I updated.
Basically, I skipped the design pattern and "who should own what" part. An example would be that one class is doing something that another class really should be doing.
2
u/s0v3r1gn Jun 15 '21
I’ve found that I’m better when I’m drunk or stoned up to a point. I’m not sure what that says about how bad my code is when I’m sober though…
4
u/gristburger Jun 15 '21
Well I’m going to assume you are new to smoking marijuana? Some top programmers smoke and code all the time, as smoking can spark your creativity. For example, George Hotz (original iPhone jailbreak creator I think) smokes while doing coding streams and he is one of the best. I can also smoke while coding and I do just fine. Dealing with the short term memory problem and ADHD is still a problem some times for me though. I just focus on one problem at a time and try not to get caught up on YouTube lol. Also, I never smoke before coding a project for school. Usually only on small personal projects.
1
u/leidogbei Jun 15 '21
NSAID has showed effectiveness
https://www.elsevier.com/connect/preventing-marijuana-induced-memory-problems-with-OTC-painkillers
1
u/hamburglin Jun 15 '21
Interesting. If I've been taking L Theanine on and off with coffee. For the day or so I take a decent amount of L theanine, I noticed a marked change in how I respond to weed.
This seems to correlate your study (NSAIDs down regulating COX-2) and l theanine doing the same thing: https://pubmed.ncbi.nlm.nih.gov/24762604/
1
u/hamburglin Jun 15 '21
I'm not new to smoking, no. I am new to trying to work while really high though. During this experience I was fighting off falling asleep or saying screw it every minute or two due to how hard it was to focus and hold things in memory.
1
Jun 16 '21
Wait till you try coding on shrooms.
1
u/hamburglin Jun 16 '21
I've had a level 5 trip and couldn't keep my eyes open it was so overwhelming. Eventually my body ceased to exist and only my consciousness existed in some kind if interstellar place where there was no space or time and everything was nothing but nothing was also everything.
Interested to see what it's like on a level 2 or 3 trip though.
3
u/xphlawlessx Jun 15 '21
Interesting...I've quite literally never written any code sober, I'm not sure I even could do it in a professional setting... Getting high is like my process for getting ready to code xD
1
u/pipestream Jun 15 '21 edited Jun 15 '21
Reminds me of the saying: "Write drunk, edit sober". Besides the fact that it doesn't really work (I read a blog post where the writer tested it), but I believe the idea behind it is to overcome writer's block. You stop thinking and just write something that you can later edit.
1
u/hamburglin Jun 15 '21
Absolutely a shot or a quick puff can help with that and still let you function enough to code.
This was an experiment when you have too much. I can't really recommend it lol. Well, unless you are just designing and brainstorming like you mentioned.
1
u/pipestream Jun 15 '21
I'm gonna sound like the most sheltered person on Earth, but I have never ever as much as seen anything stronger than tobacco irl, and k definitely don't have enough street credit to get my hands on marijuana! I wouldn't even know where to acquire it!
I do vape while coding. Originally used to when writing my thesis (to calm my anxiety), but it really just made me nauseous at the time.
I'm so uncool...
2
u/hamburglin Jun 15 '21
Imo, experimenting with drugs must be handled with care. Whatever they offer can quickly turn too satisfying and negate any positive affect you might be able to get from them. Respect is key.
Anyways, weed is pretty chill because even though it can make you lazy and unfunctional, it doesn't get much worse than that. Also, a bunch of states sell weed legally now.
2
u/pipestream Jun 15 '21
I honestly don't think I'll ever get around to it (I'm susceptible for depression and addiction). But if I ever do, I'll make sure to be careful.
2
1
u/SaysStupidShit10x Jun 15 '21
How much research have you done into weed strains before buying?
Not all strains are equal. Even just generally between Sativa and Indica, you've got a couple different styles of highs. But then you get into the strains themselves and the effects can be much different.
For instance, some strains bring razor sharp focus when playing video games, which helps because I'm a game designer on a hard core multiplayer game, and I typically get my ass kicked. But certain strains of weed and I am attuned and competitive.
I find some other strains are ideal when you haven't smoked weed for a couple weeks, and I'll smoke and then go have a shower and holy shit, fresh perspectives everywhere. Really helps you re-evaluate ideas.
And then there are some strains that are amazing for work. French Macaroon, for example, gives me that great buzz feeling and I can lose myself in some coding exercise for hours.
1
u/hamburglin Jun 15 '21
Tbh I've never been able to experiment with specific strains because I can't smoke regularly and get anything done in the first place. I've tried pure indica and sativa and while I do feel differences, they all body slam my focus and working memory. I also get extreme anxiety with higher doses and it's too much of a gamble to risk that while active at work.
Now, if I take very little that's another story. It's kind of like being buzzed vs drunk. I just haven't found that balance yet but also don't want to have to rely on it.
You'll have to trust me when I say multiple friends have badgered me about this for decades now. It just doesn't hit me the same as most I think.
2
u/Brandawg451 Jun 30 '21
I’ve got ADHD too and programming one weed makes me about 30 percent efficiency as I would be sober. But it is crazy helpful if I wrote can I can’t understand and just need to sit the fuck down and read it. Best part is I when I high I’m so interested in learning what the function does I understand my whole code. It was my saving grace when I tried to understand how to write a red black tree in C++
2
u/looselytethered Jun 15 '21
I usually program after smoking a bowl. Hell, I set the curve on my digital logics final during university while I was higher than fucking hell.
The biggest problem is remembering what I'm naming my variables.
2
Jun 15 '21
[removed] — view removed comment
1
u/hamburglin Jun 15 '21
Tbh I think it's more about how much THC and my current mood more than anything. Strains do very little for me compared to taking a lot of any strain.
14
u/amasterblaster Jun 15 '21
I program and do complex tasks high constantly, and I am familiar with this process. I am of the opinion that doing this has made me more intelligent over time.
Basically, I have to keep (a) redirecting my thoughts and (b)re-structuring my notes and code clearly (or I forget what is going on) and (c) Following a short-term and long term map of objectives.
For the payment of a-c I get to enjoy enhanced creativity, lateral thinking, enjoyment, and, well, being blazed, which is fun.
I find that after doing this for many days (if I am doing compatible work) I am more focused and present in my regular time.
This is all subjective