Jump to content

Trying to suss out optimal concentration for programming / assisting problem solving within programming

Anyone got any got concentration tips for when they're programming/coding?

 

So far I've narrowed it down to

  • Go to sleep no later than 10:30pm
  • If working on an area you know thoroughly (and don't need to think about), listen to instrumental music
  • If working on a different area you will need more problem solving elements, don't listen to music
    • If people are chatting around you then listening to music may be better however being totally isolated is probably best.
  • Changing up my scenery seems to help. If I'm particularly struggling with a piece of work I'll take my laptop away from my desk to the downstairs main table, it's not got the full tech setup but mentally it helps me.
  • No more than 2 coffees in a 4ish hour period, I may physically be very awake if I have more but I would basically be a zombie mentally after that; I don't know why.
  • If you're really stuck on a problem, try rubber duck debugging where you explain your problem to something, your methodical approach of explaining the problem usually reveals the answer ( I do prefer explaining to real people though)
  • Surround yourself with people who are interested in programming (struggled to program in my spare time when all my friends were artists, guess all I wanted to do was draw! lol )
  • (If working from home) Have a main area dedicated to working, e.g. If possible don't be gaming in the same room that you do work, have that 'work environment' Don't need that taking up brain space.

 

There's probably some things I could do in terms of dietary changes but I've not really experimented with it

 

Anything in particular work for yous? 🙂


 

Link to comment
Share on other sites

Link to post
Share on other sites

I disagree with being completely isolated.

I don't do much programming (mostly with a small Python script for my Raspberry Pi) but when I do I prefer at least hearing people talk.

 

Rubber duck debugging has come in handy. I use it more for hardware problems (what I mess with most), where I'll be stuck, go out to my mom, explain what I'm trying to do, what's not working, and maybe 3/4 of the way through explaining why it's not working I'll find the problem.

 

Main area dedicated for working, I can't really. My computers are all in the same spot, though what I do when I need to work is I'll boot into macOS. I'm not signed into Steam on macOS and I don't feel like trying out Minecraft there, but on Windows all of my games are there.

Once I get Linux fully working it'll be my coding OS, but for now I have:
Windows - recreation

macOS - school

 

Curious, what projects are you working on right now?

elephants

Link to comment
Share on other sites

Link to post
Share on other sites

It's in-house project management software for architects, not something I'm particularly interested in lol.

 

Isolation may just be something for me personally,

I enjoy being in the office with other people but I personally find it hard to tune out people talking to focus solely on my work; 

I do find instrumental music helpful for me with this but it doesn't always work for me so kinda gotta play it by ear.


 

Link to comment
Share on other sites

Link to post
Share on other sites

I would reduce my coffee to a maximum of 1 per 4 hour period. (may take a few days to adjust to the decrease, oy you could step down slowly reduce to 1 1/2 cup) or reduce coffee outside of programing. 

Diet, eat well during your meals, when I eat healthier I really do feel more alert both mentally and physically. Try and cook when possible, I find it tends to be overall better and more satisfying. It can also help to have some sort of snack nearby, like popcorn and if calories are a concern try reducing your portion sizes at meals like reducing the amount you eat at the end of the day.

Set aside some time for exercise. This is best done AFTER you finish your work, as it can wear you out but will lead to better rest, increase blood flow and a more positive attitude due to all the good chemicals your brain releases after a workout.

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, RAM555789 said:

Diet, eat well during your meals, when I eat healthier I really do feel more alert both mentally and physically. Try and cook when possible, I find it tends to be overall better and more satisfying. It can also help to have some sort of snack nearby, like popcorn and if calories are a concern try reducing your portion sizes at meals like reducing the amount you eat at the end of the day.

Set aside some time for exercise. This is best done AFTER you finish your work, as it can wear you out but will lead to better rest, increase blood flow and a more positive attitude due to all the good chemicals your brain releases after a workout.

This is something I gotta try overall to be better with, I didn't really consider the exercise to be a factor in it but yeah that makes sense you'd sleep better for it. 

Not sure if any foods are better than others, I try to be generally healthy with what I eat but haven't really looked into specifics.

9 hours ago, gabrielcarvfer said:

I'm usually more productive when I am:

- listening music (there's a huge avenue in front of my apartment);

- when I'm alone (e.g. home office was fine, until my brothers had to say at home the entire day and I'm the one keeping the home clean/tidy...);

- keeping a list of all daily tasks (it really helps when you're doing something you don't want to or something big that will take a lot of time). 

+1 to keeping lists! My memory isn't the best so this really helps keep me on track 😄 Not to mention it's satisfying 😎


 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 3 weeks later...

Hi, 

I would add something to what was mentioned before. When I'm stuck or when I start to get distracted, I change pace. I do an other task or write some documentation (you know, the thing nobody read because it was never updated...).

An other thing that work well is coding practice challenge/programming Kata. There are many sites that proposes small programming exercises (I don't have one in particular. I search on DuckDuckGo. The last one I tried is edabit.com. It was the first time I tried it. It was OK. Those sites proposes a range of exercises difficulty that allow you to be challenged (or not). I often select an easy one, but try to find as many solutions as I can. I generally do it for 20-30 minutes.

I often see new avenues that I didn't consider before when I go back to the evil, unsolvable bug.

Edited by mbeware
Formating because it was a wall of text.
Link to comment
Share on other sites

Link to post
Share on other sites

From my experience, it's in some ways similar and different in others:

  • Exercise is extremely important. Gym and jogging alternating days every morning. Getting it done in the morning leaves the entire evening free to do anything I want. Plus is doesn't wear me out, it actually helps with alertness.
  • One cup of coffee in the morning, maybe one immediately after work if I feel like having one, but no later (minimize impact on sleep). I'm thinking of completely ditching coffee, for one, I had complete caffeine addiction beforehand, withdrawals sucked. The problem is that I love coffee... But because of coffee, energy roller coasters happen, much like with sugar. On that point...
  • Diet. Low carbs, minimal sugar. Not only that keeps body weight in check, no sugar rushes mean no energy crashes during the day. I get a protein shake after working out in the morning, pretty low carb lunch (mostly salads, some meat in there at times). Evening I keep a bit more lenient, let myself enjoy some good food from time to time.
  • Commute. It's a weird one, but I've found that a commute helps me to get in the zone. I've discovered this when all of this WFH thing started happening... A short (up to 30min) commute is great. Going via bicycle is great.
  • Workspace. Good headphones (not necessarily noise cancelling), an ergonomic keyboard-mouse set (not waiting for repetitive strain damage to occur), comfy office chair, ultra-wide monitor ideally, but 2 regular ones are fine, two notepads (one is daily stand-up notes, other is where I unload my ideas into, flow charts etc).
  • Tools. Due to the nature of my work (and because I like it, of course), I use Linux. Due to the languages I work with, I can drop the IDE game completely and work with tmux+kakoune+language server combo. I plan on staying with it indefinitely at this point, it's great. I can use it for all languages I work with, I don't need an IDE for each. That means all the motor skills 100% transfer from one language to the next. And did I mention that this compo is superbly fast? On another note, tiling window managers are great, but I'd hate to have something different at work and at home, so I'm sticking to Pop!_OS for now. That will change though, as the extension there is buggy as hell, so I'm looking for an alternative and Budgie DE seems to work great with it's Window Shuffler plugin, will cover all needs. That move might happen pretty soon.
  • Focus. Colleagues are a great help, as it turns out, both when discussing things on work, giving ideas and some banter at times helps with sanity. Have your high focus time, but don't forget to wind down for a bit too. Focus is a budget, overdrawing it is unsustainable. WFH is goes downhill after a while for me, I feel that I don't get proper interruptions, don't feel work time properly.
  • Sleep. Get enough of it. Pretty different for everyone. Waking up can suck in the winter, since we get about 8 hours of sunlight (you leave home it's dark, you come back home - it's been dark for over an hour already). so I've got one of those bedside alarms that turn up the light up slowly, before the alarm rings, seems to help.

I guess that's all. Take from it what you will 😄

Link to comment
Share on other sites

Link to post
Share on other sites

I have tried a bunch of things over the last 25 years career and what I figure out that work for me is :

 

- Drinking more water makes my brain sharper and force me to the bathroom more often which the walking process make my brain work even more

- A fan that blow air close by makes a repetitive sound which helps focus when working out logic/algo on paper. This is mostly to force my brain to ear the fan and nothing else around so when thinking it's like shutting down every other sounds around as the fan take focus over the rest.

- Always writing (notes and logic) on paper gives me a better view of what are my idea's vs a notepad line by line

- Listening to favorite songs with headset/earbud (not speaker) while implementing code that I have already planned boost my coding speed.

- Rubber ducking (colleague when at work and a Furby at home) helps a lot when really stuck.

- When completely clueless about how to do something or don't know where to start what it do is I start to list the worst way to do what I want and that gives me a bunch of base line which I slowly improve upon until I find what  I was looking for.

- Exercise is great, I don't need anything intense, just a walk is enough.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×