• Mars2k21@kbin.social
    link
    fedilink
    arrow-up
    54
    ·
    1 year ago

    Showers help you come up with ideas? Guess I’ll start taking showers from now on, seemed pointless before.

  • m-p{3}A
    link
    fedilink
    arrow-up
    27
    ·
    1 year ago

    I’m not a programmer but a sysadmin, and being able to work from home has multiple benefits. When I get stuck on something, I like to jump in a shower just to decompress and honestly it sometimes help to gain a different perspective.

    Otherwise I like to just get up for a couple of minutes to make a coffee, or take the dog for a walk for maybe 10 minutes around the block and breathe some fresh air.

    • grooving@lemmy.studio
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      There is something about the zen vibe of a shower which gets my creative brain going ham. I come up with so many ideas in the shower. But I don’t want to waste hot water 30 mins a day. I’m yet to find something that works in a similar way. Like a walk is fine, but the white noise of a shower, in the heat with water massaging your shoulders, water dripping over your face. It’s powerful stuff. I’ve tried standing under a heat lamp, but it doesn’t hit the same way. Any ideas?

      • glockenspiel@programming.dev
        link
        fedilink
        arrow-up
        4
        ·
        1 year ago

        For me, it is the mindless reptition or task accomplishment. Showers work well because I don’t have to think about what I’m doing, which frees my mind up for something else. There’s no rush, there’s plenty of soothing ambiance, and it just works. I find doing chores around the house can trigger the same type of state. Putting dishes away lets my mind wander and problem solve. So does putting away laundry, dusting, sweeping, stuff like that. I usually need to wear earbuds and play an ambient noise to help me along.

        But showers are still the best. You hit the nail on the head in your description about why it works. I think the key is anything relaxing, but not too relaxing such that you get drowsy.

    • NixDev@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      i do the same. If I get stuck on something best thing to do is get away. Shower, walk, food shopping, etc… just get away from the problem and destress so you can tackle it with a fresh perspective

  • dbilitated@aussie.zone
    link
    fedilink
    arrow-up
    21
    ·
    1 year ago

    on the one hand, yes, I write software and take showers when I’m stumped because it’s a great way to think through it.

    on the other hand the world didn’t need an article about it.

  • fjordo@feddit.uk
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    1 year ago

    I feel personally attacked. Just for that I’m not showering for 3 more weeks.

  • abhibeckert@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    16
    ·
    edit-2
    1 year ago

    That’s nice and all, but if you submit your array reversing code to me for peer review, I’m going to ask our boss for a private meeting, where I will ask him to fire you. And if you were just hired a week ago… you’d still be on probation and very easy to fire, we’ll just call up one of the other job applicants for your position and see if they’re interested.

    Don’t waste my time by asking me to review unnecessarily complex code. Also we have enough bugs already and you seem to be going out of your way to introduce even more.

    For the record - the right way to reverse an array in PHP is like this: array_reverse($array). And if that’s too slow… just don’t reverse it at all. Use -- instead of ++ in your for loop.

    (PS: Ugh. Lemmy sucks for posting code… didn’t like some of the symbols and ate my whole comment. Had to write it twice. Sorry the first one was better)

    • davawen@programming.dev
      link
      fedilink
      arrow-up
      8
      ·
      1 year ago

      That’s not the point of the article though. Reversing an array is simply an exemple of a very simple CS puzzle. Of course it’s common enough to have a builtin function. No, this won’t be written in a code base, or asked for a code review. That’s not the point.

        • apd@programming.dev
          link
          fedilink
          arrow-up
          5
          ·
          1 year ago

          It’s an algorithm question. If somebody gave me your solution in an interview I would ask them to solve the problem without a dependency. These questions are about demonstrating your ability to code whilst understanding space & time complexity.