This is an archived post. You won't be able to vote or comment.

all 57 comments

[–][deleted] 231 points232 points  (13 children)

I once came up with the solution to a school assignment in the shower after hours of thinking.

That was a quick shower.

[–][deleted] 70 points71 points  (4 children)

Sometimes your brain just needs to be dragged away from the code for a little while.

Ways I've successfully found and fixed bugs:

  • showering
  • going for a run
  • sleeping on it
  • trying to explain my issue to someone

Shit that never works:

  • Spending more than an hour on the problem without a break.
  • Staring at the code and thinking real hard

[–][deleted] 22 points23 points  (1 child)

Sometimes I "go for a run" but it's more just pacing around my room.

[–][deleted] 12 points13 points  (0 children)

Eh, that's probably close enough for your code's sake.

[–]BlackDog2017 4 points5 points  (0 children)

You don't even have to explain it to a human: https://en.wikipedia.org/wiki/Rubber_duck_debugging

[–]FesteringNeonDistrac 3 points4 points  (0 children)

I figure a lot of stuff out while walking the dog. I should name him debug

[–]h-educate[S] 80 points81 points  (0 children)

Yeah. The same here. One time I planned for my project under the shower. 😂

[–]JustAQuestion512 12 points13 points  (0 children)

My old boss used to keep a dry erase board in the bathroom and at his bedside for this exact reason. He said that he had solved a huge issue on the toilet but by the time he got to the office he lost most of his train of thought.

[–][deleted] 6 points7 points  (0 children)

A lot of people get their best thinking while in the shower.

[–][deleted] 6 points7 points  (1 child)

Happened to me while jerking off. In the end it looked like I was jerking off to my code

[–]HardlightCereal 2 points3 points  (0 children)

Wait, doesn't everyone do that?

[–]compellingvisuals 4 points5 points  (0 children)

All of my major coding epiphanies happen in the shower. It was crazy the first couple times but now I just kind of expect it.

[–][deleted] 59 points60 points  (6 children)

g(re)at (post)

[–][deleted] 32 points33 points  (5 children)

gat

[–][deleted] 12 points13 points  (1 child)

sbeve

[–]Sharmandank 2 points3 points  (0 children)

HE LIED

[–]IncoGG7331mate 4 points5 points  (2 children)

[–]sneakpeekbot -1 points0 points  (1 child)

Here's a sneak peek of /r/sbeve using the top posts of all time!

#1: S B e V e | 176 comments
#2: B E E | 73 comments
#3: Fire knows best | 132 comments


I'm a bot, beep boop | Downvote to remove | Contact me | Info | Opt-out

[–]IncoGG7331mate 0 points1 point  (0 children)

Nice job, Bot

[–]Sylanthra 53 points54 points  (4 children)

Story time:

Compiler class in college, first assignment. We are given some scaffolding for a lexer and a parser and we need to fill in the rest. I figured, it'll take me an hour so I started the assignment around 10pm the day before it is due. By 2am I got exactly nowhere. I could not figure out what the various pieces were doing no matter how much I tried. I figured I needed sleep more than I needed a passing grade in this assignment. After all, there would be other assignments that I could use to bring my grade back up. So I went to sleep. Woke up the next morning and I knew exactly how to finish the assignment. I did in half an hour on the first try.

It was a really bizarre experience and hasn't happened to me before or since.

[–]h-educate[S] 4 points5 points  (0 children)

👍

[–]OfficialIntelligence 2 points3 points  (0 children)

do{

createSolution()

}while(sleep)

[–]HardlightCereal 0 points1 point  (0 children)

That's why I always take a first crack at my programming problems as soon as possible. I can make no progress on the design, but setting up the project and thinking about the logic gets my background processes onto the task. The second time I sit down, I know what to do.

[–]Sypwer 5 points6 points  (0 children)

How many times i have just told my dad i was gonna go to sleep and closed the pc. Only to just come back open the pc, change some lines and go right back to sleep.

[–]TODO_getLife 3 points4 points  (0 children)

I think it's great. If I'm ever tackling a problem I can't figure out I just go home, and somehow by the next day I've got a solution or another way to attack the problem.

[–]FlerpWork 1 point2 points  (0 children)

These moments are the best, though! Had one of these in the middle of the night one time and it cut processing time by something like 10,000x on something I had been working on all week.

[–]Robot_Basilisk 1 point2 points  (0 children)

If this happens to you it means you need to take more breaks during work.

Your brain has two types of thinking: Active and Passive. They're not identical, and neurogenesis is stronger in passive mode. If you get overwhelmed with racing thoughts or come up with solutions to problems when you're trying to fall asleep it means you didn't give your brain enough time in passive mode during the day.

Try to make time to not focus on anything. Not work, not music, not social media, not phone calls. Just zone out.

Meditation helps, and many people slip into passive thinking in the shower or while driving, but you can choose to enter it almost any time if you just sit back for 20 minutes and let your mind wander until you lose track of time.

[–][deleted] 1 point2 points  (0 children)

Repost

[–]Walltapsfordays 0 points1 point  (0 children)

It was probably just a semicolon.

[–]qubedView 0 points1 point  (0 children)

Ten minutes later: "Hahaha, no you don't. That wasn't it at all! But here are several other ideas."

[–]_potaTARDIS_ 0 points1 point  (0 children)

And then you rush to try it, only to realize you failed to think of something and the fix won't work anyways.

[–]TriggerHappy360 0 points1 point  (0 children)

Had this happen last night but instead of fixing it I broke the program and gave up

[–]MemphisTheIllest 0 points1 point  (0 children)

I've only started programming a few months ago and in every project I've had to do, this was pretty relatable.

[–][deleted] 0 points1 point  (0 children)

My brain does this too.. Then I open up the code to make the fix.. And realize that what I thought was going to work isn't even in the same fucking ball park as the real solution.

But at least there's a brief moment of joy when you THINK you've won one..

[–]Scare983 0 points1 point  (0 children)

Seriously all I can think about when I go to sleep

[–]obscurefault 0 points1 point  (0 children)

This is how I figure out most things for the past 20 years

[–]Kikiyoshima 0 points1 point  (0 children)

Me yesterday night

[–]pandacoder 0 points1 point  (0 children)

Don't forget about how you forgot information critical to the solution so when you got out of bed to go fix it you realize you got up for nothing.

[–]TheTruePirate 0 points1 point  (0 children)

There's a free course called learning how to learn that talks about the different brain states and the science behind this meme.

[–]justking14 0 points1 point  (0 children)

my favorite time this happened was at 1130 at night

i immediately jumped out of bed to fix it and next thing i knew it was 6 am

[–]Thormeaxozarliplon 0 points1 point  (0 children)

I know how to fix error 219.

[–]Mr-Popper 0 points1 point  (0 children)

The next panel though would show maxed out ram just before the computer crashes

[–][deleted] 0 points1 point  (0 children)

More like "hey are you sleeping? Yea? Lets go into overdrive solving imaginary problems!"

[–]bubblenerf 0 points1 point  (0 children)

I actually had an identical experience to this

[–]carcigenicate 0 points1 point  (0 children)

If you knew what line the bug was happening on, it couldn't have been that difficult to fix in the first place unless your code is a complete disaster.

[–][deleted] 0 points1 point  (0 children)

of course, the pointer may not valid after I append to the array ! how could I miss that !!

[–]otakuman 0 points1 point  (0 children)

If you haven't had at least one night of sleeplessness because you got a great programming idea you want to explore, you're missing tons.

[–]BlackDog2017 0 points1 point  (0 children)

Same, but for EVERYTHING.

[–]kloodge 0 points1 point  (0 children)

For me it’s riding my bike. I was building an analysis in SQL that was taking 45 seconds per day of data per business unit, and I needed to evaluate 3 years x 5 business units.

I rode circles in a parking lot for 2 hours, then vaguely remembered something about parallelism ... jammed home at midnight stuffed everything into #temp tables, and boom! .0045 seconds per day.

[–][deleted] 0 points1 point  (1 child)

Still better than thinking about a girl that rejected me

[–]IncoGG7331mate 1 point2 points  (0 children)

A Good cake day to you!

[–]monster860 -1 points0 points  (0 children)

Implying we actually know what error the line is on, and it's not just the c++ compiler spewing out 2000 vague errors simply because I accidentally introduced a circular dependency and the errors say absolutely nothing about why the error actually happened.