Comment by Martin_Silenus

Comment by Martin_Silenus 18 hours ago

29 replies

Sleep. Best side task for your brain.

How many times has this happened to me?

You struggle with a feature or a bug, you think about it, you weigh the pros and cons for hours... because you don't want to start something that will set you back. You're tired, but you don't want to go to sleep until you've at least made a decision for tomorrow.

Go to sleep. Now.

Then you wake up knowing immediately what to do. You hardly believe it, because it was so hard to find before you sleep. And you do it. And it works. And you know that sleep was the key.

Stratoscope 7 hours ago

I've shared this before, but it seems relevant here:

Several years ago a Facebook recruiter invited me to interview with them. It mostly went well, except I bombed the leetcode algorithm quiz.

The next day, as I expected, they sent me a polite note thanking me for interviewing but they would be moving on with other candidates.

The morning after that, I woke up and before I opened my eyes I saw the complete solution on the back of my eyelids, about 20 lines of code.

I stepped through the code mentally and thought, "Yes! This will work!"

So I ran to my computer and typed the code in to test it. Other than one bug - this was old-school JavaScript and I'd forgotten one var statement, so there was an inadvertent global - it worked perfectly.

brettgriffin 7 hours ago

This is frustratingly accurate. I was just working on something, pulling 16+ hour days for days on end. Not because I had to, but really out of pure obsession.

The raw hours of work were certainly noticeable, but it was embarrassing how difficult tasks the night before suddenly became a breeze the next day.

esperent 17 hours ago

Also exercise.

Sleep restores you. Exercise is the spark.

  • mikepurvis 12 hours ago

    Good exercise also contributes to good sleep. I sleep like a log after a good bike ride or an evening out swing dancing, but if all I did was sit at my desk all day then it’s a lot more likely I’ll be tossing and turning or doom scrolling into the wee hours.

    • polishdude20 11 hours ago

      Just had a very tiring long run yesterday. Spent the night still scrolling haha.

      • mikepurvis 10 hours ago

        Ha, well ya can’t win em all I guess :)

  • LeftHandPath 8 hours ago

    Hiking is my go-to when I need to figure something out. I think walking also helps chew on complex problems, more so than more intense exercise like strength training and running (though that's also beneficial).

binaryturtle 15 hours ago

I just take a hot bath… best ideas happen in the bathtub for me.

  • libraryofbabel 12 hours ago

    Mathematician JE Littlewood was a big proponent of walking and shaving for ideas:

    > “Illumination, which can happen in a fraction of a second, is the emergence of the creative idea into the conscious. This almost always occurs when the mind is in a state of relaxation, and engaged lightly with ordinary matters. Helmholtz's ideas usually came to him when he was walking in hilly country. There is a lot to be said for walking during rest periods, unpopular as the idea may be. Incidentally, the relaxed activity of shaving can be a fruitful source of minor ideas; I used to postpone it, when possible, till after a period of work.”

    I also recommend walking, I leave shaving to the men to try, and would add that like many others the shower is my most happy place for ideas and hitting on the causes of difficult bugs.

  • drebz 14 hours ago

    I once solved a customers problem, and understood the problem of my broken washing machine during one short shower before going to bed. Best shower ever.

  • spongeb00b 15 hours ago

    Douglas Adams was a big proponent of baths to help his writing

  • snarf21 15 hours ago

    I design board games and almost all of my ideas come while walking or driving. Sometimes we just need to give our brain a minimal task to occupy it and then we can more easily get into flow. This is also the same result of the Ballmer Peak / 1 Beer Buzz method. [https://xkcd.com/323/]

CalRobert 16 hours ago

If only my kids would let me..

  • jay_kyburz 7 hours ago

    Seems painful now, but in the blink of an eye they will sleep through the night and when you look back years later you'll wish you pick them up and rock them to sleep again.

    • throwaway31131 6 hours ago

      “The days are long, but the years are short"

      Couldn’t be more true…

eschneider 11 hours ago

So much this. As I've gotten older, instead of working half the night on a difficult end-of-day problem that I'm stuck on, I just set it aside at the end of the day and by the time I start back up in the morning, I've got a good idea how to solve it.

Does it mean THAT problem gets solved later? Sometimes, but often not. And more importantly, I'm maintaining a pace that's SUSTAINABLE. I can crank on hard problems almost constantly, but I leave myself some space so I don't get burned out.

patrick451 13 hours ago

What I have noticed is that often, what sleep or rest gives me isn't so much a new insight but just the gumption to make a decision or grind through what I know needs to be done.

  • jbeninger 11 hours ago

    That is a great insight. Often the thought that breaks through developer block for me is "<sigh> fine, I guess I can't do it that way"

aswanson 17 hours ago

Facts. I don't do the late hours on code anymore either. Rest is essential.

oldmandev 16 hours ago

I agree that sleep and exercise are key.

Some have pain and/or insomnia waking them up at night with the inability to get back to sleep quickly or at all, and some have pain/injuries that make exercise less fun.

Telling us to sleep and exercise is like telling homeless and starving people to get off the streets, find a job, eat a good dinner, and buy a house. It sounds nice, and we’ll do our best, but the world you live in is different, and you don’t understand.

  • shakna 16 hours ago

    True, but as someone with a pain condition... Most throwaway suggestions won't help out. People always try to help, but rarely can. That's fine. Take the kindness, discard the advice.

    But because I've struggled with this thing for decades, I probably do have enough tools to find my own way. And if I've run out, it means I'm about to burnout and need to find a way to restore ASAP.

  • arcanemachiner 9 hours ago

    When people are giving generic advice, they're obviously not talking about corner cases.

    Don't be such a victim. Not everyone is going to think of your exact situation in every sentence they write.

    • shakna 2 hours ago

      I'm gonna call you out on this one, sorry.

      Telling someone who is victim not to be such a victim is... Nothing but being a dick. They're hurting. There's better ways to talk to people. That people don't think of them, is kinda how they end up being a victim in the first place. They fall through the cracks, and that makes them more vulnerable.

      Was this the time and place? Probably not.

      Are you helping? Fuck no.

      • arcanemachiner an hour ago

        Your sentence did not address every possible marginalized group, and is therefore willfully disregarding their situation.

        Your swearing is offensive to someone reading your post. Your misuse of grammer as well. What about the people who can't read your post because they are blind, have dyslexia, don't have access to the Internet, etc.? How dare you!

        Did you consider the viewpoint of every possible person who could have read your post before you submitted it? Of course not, because that's impossible, and would be an insane request to make.

        • shakna 33 minutes ago

          You made a personal attack. There were better ways of speaking.

          You've now tried again, to make a personal attack. (I'm so sorry my grammar isn't American. I'm not.)

          How about, if you really want the conversation, you post more than flamebait?