DEV Community

Ben Halpern
Ben Halpern Subscriber

Posted on

How do you shift between the coding mindset and other head spaces?

I find myself having to shift between different frames of mind, in my work and otherwise.

My code brain is different from the brain I need elsewhere. How do you do it?

Top comments (56)

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

How I get through the day:

while true {
    input = get_senses()

    if input.type == human {
        if random.next_bool() {
            self.smile()
        } else {
            self.nod()
        }

        self.voice( "mhm" )

    } else if input.type == love {
        self.service_stop( service::reason )
        self.service_start( service::emotion )

    } else if input.type == code {
        self.fingers.echo( input )

    } else {
        self.drink( coffee )
    }
}
Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I'll hijack my own comment for a serious response.

I have a feeling one's ability to switch mindsets may be, in part, significantly genetic. Some people are just better at switching than others. I learned at one point it happens to be a skill of mine. Perhaps my ability to lead a team, talk with other teams, and juggle side-jobs and projects, came from this ability, and not vice-versa.

I'm sure everybody can improve this ability, but I suspect they'd be subject to the same constraints and problems I am.

First off, it's draining. Every switch takes a little bit of energy. Even if I don't notice it during the day, I notice it in the evening. When I'm sick I notice the ability slips away. As I get older it gets harder. If I'm facing questions of my career goals, it gets harder again.

I maintain a healthy lifestyle to keep up my energy.

Second, it requires a certain level of mindfulness and prioritization. In order to switch to a new task requires putting the old task out of your brain, and pulling in the environment of the new one. You can't keep mentally working on an old situation, nor only work with part of the frame of the new one.

There's all sorts of things that prevent this transition. Worry is a big factor. Procrastination another. Boredom is also an issue -- it's hard to transition to a boring mindset. Both big and small picture details can get in the way. Figuring out a way to just say, "fuck it, I'm working on -this- now" is key -- yet provides no clear avenue for achieving that.

Perhaps the ability to switch mindsets is tied more to your overall health. The fitter you are, the easier it is. Perhaps this is what drew into becoming so fit, learning massage, meditation, and ultimately to mentoring and coaching.

Collapse
 
bluebell_lester profile image
Bluebell Lester

When I read this I feel sorry for your brain. It is not a robot-slave. No need to push it like that.

Collapse
 
pavonz profile image
Andrea Pavoni

In my algorithm, I also authenticate with user and password in the morning.

My problem is that sometimes I forget credentials to log in into my brain, at least until the next alarm clock ;-)

Collapse
 
scrabill profile image
Shannon Crabill

"Sorry, I can't work today. I've been locked out of my brain. K, thx"

Collapse
 
900107561 profile image
900107561

That didn't work, i got an error.

Collapse
 
dance2die profile image
Sung M. Kim • Edited

I believe that the mind follows the body & vice versa.

If you need a different frames of mind, you probably need be in a different place physically.

Collapse
 
himamegahed profile image
Ibrahim Hasan

Totally agree usually, I go out to have a cup of tea & donuts with some beautiful landscape so that I can ease my eyes ☕️🍩❤️❤️

Collapse
 
dance2die profile image
Sung M. Kim

That's what I typically do as well. I go to a local cafe to read and think with a nice cup of coffee & donuts ☕️🍩❤️❤️

Collapse
 
bgadrian profile image
Adrian B.G.

Definatelly, I need to get up and move away a bit from the laptop or close it before I can focus on something else.

Collapse
 
dance2die profile image
Sung M. Kim

At home, I walk to the living room and sit and come back :)

Collapse
 
dandevri profile image
Danny de Vries • Edited

Small little trick that works really well for me: make different users on your MacBook. I have one 'personal' user and one 'work' user. Each have different programs installed and are logged into different accounts.

Even if I'm in the same space physically I switch between roles.

Collapse
 
zackdotcomputer profile image
Zack Sheppard

I do something very similar to this except using Spaces on my Mac, but yeah a "distractions" space, a "work" space, and a "code" space.

Collapse
 
dandevri profile image
Danny de Vries

You mean the integrated macOS spaces you can switch between? A lot of people seem to like Workspaces by Apptorium.

Thread Thread
 
zackdotcomputer profile image
Zack Sheppard

Very cool! Thanks for the tip, I hadn't heard of that app yet, will give it a try.

Collapse
 
tunaxor profile image
Angel Daniel Munoz Gonzalez

This sounds interesting! I will try this

Collapse
 
qm3ster profile image
Mihail Malo

:o

Collapse
 
david_j_eddy profile image
David J Eddy

Lets look at your question from a different angle: why switch at all? In my own life trying to normalize, automate, and provide redundancy is a minor goal for every day existence. Coupled with short/med/long term goals a road map becomes apparent to the end desired state.

Car breaks? Ride share back up.
Fridge empty? Shop / Food delivery.
Life knocks you down? Have a flow to get back in the zone.

At the end of the day always be working towards something. What is the desired end result of an action; programmatic user interaction or going to the DMV. Have a goal and work towards it. This way the coding brain is adapted to the goal brain.

Hope this helps

Collapse
 
johnnytwowheels profile image
johnnyTwoWheels

What I try to do:
Observe
Orient
Decide
Act

What actually happens:
Distraction occurs
Mind wanders
Go get more coffee.

I believe changing mindsets requires very intentional effort.
A change in physical surroundings helps me break free from where I want to leave (mentally) and makes it easier to enter the new desired space.

Collapse
 
binarypatrick profile image
BinaryPatrick

Isn't that a military thing?

Collapse
 
progrium profile image
Jeff Lindsay

Yeah, OODA loop developed by John Boyd. Great thinker. There's a few books on him, all recommended. It's found its way into a lot of other contexts.

Collapse
 
johnnytwowheels profile image
johnnyTwoWheels

Yes it is.
I just use it to help me switch contexts, whether I'm coding, or in a meeting, or interviewing someone. The technique works for me.

Collapse
 
alanmbarr profile image
Alan Barr

I usually will change my location often times location is associated with an activity. When I am coding vs when I am testing are two different mind spaces. In order to be creative it requires a habit of trying out new things and combining them. I like things like oblique strategies cards (Ambiguous Oracle) and exercises from "A Whack on the side of the Head" by Roger von Oech. Some simple strategies would be did you try laughing at your idea? What if you reversed it? Ask what if's in general.

Collapse
 
ben profile image
Ben Halpern

That's good advice

Collapse
 
weirdmayo profile image
Daniel Mayovsky

This questions bothers me as well, from a bit of a different angle/experience.

After doing JS coding for more than 2.5 years more than 5 hours a day I, sometimes, find myself with such issues like:

  • Slow response to basic questions (What is your name takes me 15 seconds to think about)
  • Memory read/write efficiency. Takes forever to remember things and hard to remember.
  • ADHD symptoms.

When I do large breaks from programming, like going on a 2 week trip, they go away one by one and I become a totally normal human being without any of those issues. When I dive back into what I love, I become slow and unresponsive outside of coding. And it takes me forever to switch back into normal human mode.

How do you switch/unload your mind faster than a 2 week trip?

Collapse
 
wolfhoundjesse profile image
Jesse M. Holmes

ADHD is so perfect for this type of work. Getting locked into coding for hours on end feels so good to my brain.

At the end of the day, if I've left something unresolved, it's almost impossible to pull me out of that mindset. I end up being at home, but not really being there. I miss my family. Like you, responding to what should be very basic questions seems to take forever.

Music has been a big help; it's always an option, but it doesn't always do the trick. It probably helps that I'm a musician. Any amount of travel is the cure-all for me, too. As soon as the road is opening up before me, my creative self emerges.

The thing that helps me the most: #ITakeMyPills

Collapse
 
weirdmayo profile image
Daniel Mayovsky

Well I am 18, and I am not diagnosed for ADHD yet (which means I can't claim that I don't have one, but most likely I don't).

It is necessary for me to be able to switch the mindset on a whim, since I am in college and I have family and other stuff that are in need of my attention sometimes. Of course I would really like to lock myself in a room for some coding, if that option would be available.

I love listening to music and I play bass, but it usually slows me down instead of putting me back onto a "normal human being" path. But yeah, I guess just focusing on one thing would be a good thing for me later...

Collapse
 
nickyhajal profile image
Nicky Hajal

This is such a great question!

My wife is from Barcelona and for about 6 months before we were married we had to be outside of the US as we waited for her visa. We stayed at a family place they have about an hour South of Barcelona in a somewhat rural area.

I spent most of my days there coding but twice a week we'd go to a little family-owned farm where they taught Spanish-style horseback riding. I'd never done it before, but it seemed like a fun experience (it was!).

There was a 20-minute drive to get there and pretty much without fail I'd be in a less-than-agreeable mood the entire ride. I'm a pretty positive person, but we'd go in the middle of the day and my brain was 100% in code-mode. I was still thinking through issues, stuck in the mental map of my work and just didn't want to talk or deal with the outside world (which made me a pretty bad adventure-companion).

The funny thing, though, is that as soon as we started getting the horses out of the stables and saddled up, I'd snap out of it. And by the time we were riding, my mind was just completely clear, in the moment, laughing, smiling. The car ride back would always be full of energy, conversation, and happiness. Completely night-and-day shift and nothing changed but my own mental space.

Thinking about it now - this definitely does happen in other ways and I'm actually not sure I've really given it the attention to find a reliable solution.

It seems like what worked well with the horses was having something physical and slightly dangerous, which forced me to focus on the present moment and break free of my code-mind.

I wonder if there's some hack to achieve similar characteristics in an office setting, that can be done on the way out the door.

Collapse
 
scrabill profile image
Shannon Crabill

I tend to say tasks aloud, to myself that require a mind shift. If I'm putting something off, like, writing that self-evaluation that's due in 3 days, saying "At 4 o'clock I'm going to work on my self-eval" helps. It's weird, I think, but it helps me. Sometimes I timebox it with "I'm going to work on documentation for 30 minutes".

For me, knowing when I'm liking to be a better or different mindset is key. Morning are busy—hello, meetings—and I get bored with production work in the afternoon, so that's when I do my more focused tasks like writing or updating documentation.

I try to be intentional in what I do, when I do it and not multi-task.

At home, I find it easier to get overwhelmed and not get into the right mindset due to—seemingly—competing priorities. Do I unpack that box or try to debug that thing? OR do I find another cooking show on Netflix?

Collapse
 
williamholt profile image
William Wheat Holt

My background is in PR so the parts of the day when I'm interacting with people, meetings, presentations, writing, etc, are when I'm at my most natural.

I often find that I have to "trigger" the right mindset when I'm coding. Put in my headphones, sit at my desk, pull up just the programs/files that I need for this specific feature, and find the Flow zone.