1. 46
    Programmers: You Snooze, You Win programming lobste.rs
  1.  

  2. 64

    According to researches, your sleep quality and stress level matter far, far more than the languages you use or the practices you follow. Nothing else comes close: not type systems, not TDD, not formal methods, not ANYTHING.

    Plagiarism is bad, mmkay?

    Edit: turns out this was published on FreeCodeCamp, too. I’m pretty mad.

    1. 29

      I have removed the story URL due to your sufficient demonstration of being plagiarized in the article. Changing the story URL is the most immediate and parsimonious change I can make, as it preserves the rest of the post and everyone’s comments. I have reached out in a PM to @hpolatyuruk asking for an explanation and to further investigate. Thank you @jonahx for bringing this matter to my attention.

      1. 8

        Thank you to both @alynpost and @jonahx.

      2. 15

        That is pretty appalling.

        It’s funny, when I read this quote in his article:

        Clean Code? Doesn’t help to implement new functionality and to find and solve a bug. There seems to be no immediate benefit of Clean Code in the form of understandability.

        I actually thought to myself: The cited study doesn’t do anything like “prove” that, especially when you actually look at the details of it, the small sample size, etc… Hillel’s talk on this was a much more fair and nuanced take.

        For those interested: Intro to Empirical Software Engineering: What We Know We Don’t Know • Hillel Wayne

        1. 5

          the worst part about it is that it doesn’t detract at all from the point if they were to cite their quotation. in fact it lends credibility to the author if they had. shame.

          1. 0

            Hello @hwayne, I am the writer of this article and I’ve made a mistake by not giving you credit. However, I’ve learned from my mistake and I’ve updated my article here and on FreeCodeCamp too. I gave you credits as well. Your tweet was one of the inspirations for me to write this article. For this mistake I am sorry and please accept my sincere apology.

            1. 13

              I gave you credits as well.

              You added a general “thank you for the inspiration” at the bottom of the article.

              When you quote someone verbatim, the quoted words themselves need to be quoted (either using quotation marks or an html blockquote tag) and the attribution should be inline, or at minimum given by footnote. Inline attribution is far more appropriate here.

              If you actually want to give credit where it’s due, you should put the general thank at the top, not at the bottom where most readers won’t even see it. The correction you’ve made so far effectively gives you plausible deniability while still allowing most readers to give you credit for the ideas.

          2. 14

            I’m happy to someone trying to dispel the “Hollywood tells me real programmers do X!” Sleep deprivation is pretty close to the mental equivalent of being drunk.

            When I don’t get enough sleep, I find a 15-20 minute nap 10x more useful than drinking caffeine. Getting actual sleep is better, but naps > caffeine.

            EDIT: Maybe I didn’t sleep enough because I typo’d “nap”

            1. 6

              Sleep deprivation is pretty close to the mental equivalent of being drunk

              More people need to know this. And then they need to think (for like, 30 seconds) about the medical industry’s obsession with making junior doctors work 18-36 hour shifts because “that’s what last bunch did to me when I was her age”

              1. 4

                I totally agree with this sentiment. Since I started working from home (February), I’ve cut back on my coffee consumption (still need one in the morning), and I’ve been taking a 20 minute power nap (feet elevated) around 1pm. It really helps. I’m mentally refreshed in the afternoon. I do worry that I might have a difficult time transitioning back to a normal office environment some day.

              2. 12

                Excellent article, thank you for writing!

                A few tips for sleep that work well for me:

                • A cool, dark room with a good mattress

                • You should fall asleep fairly soon after getting in bed. If it takes more than an hour, you’re too early or late (barring other issues).

                • Supplement with magnesium. Most people are deficient. Citrate is a good place to start.

                • Doing heavy compound lifts (squat/deadlift/etc) will knock you out quickly.

                I’ll also use this space to publicly lament the death of the Zeo Sleep Tracker. This was a sort of debugger for your sleep that used EEG to track sleep states. This works much better than most contemporary consumer-level trackers. It wasn’t perfect, but it was a metric that I used over the course of a year to run lots of small experiments on what helps my sleep.

                1. 1

                  I’ll also use this space to publicly lament the death of the Zeo Sleep Tracker. This was a sort of debugger for your sleep that used EEG to track sleep states.

                  Like the EEG on an Apple Watch? Or a separate device? I didn’t know people had EEGs in their home (apart from the afore-mentioned watch).

                  Edit: The Apple Watch performs an ECG (electrocardiogram - related to the heart) not an EEG (electroencephalogram - related to the brain). So, not what the parent poster was talking about.

                  1. 4

                    The Zeo was a headband/device combo, later simplified to a headband + smartphone. The headband collected EEG data while you slept, and went around your forehead. It wasn’t the most comfortable thing, but I found it relatively unobtrusive. In the morning, the data was analyzed and a sleep score was calculated. You could also look at a graph of the four different sleep stages to get an idea of how long you were in each.

                    EEG is regarded as the best way to find out this data. Most other devices that rely on other types of measurements don’t get as close as Zeo did. Yet another case of newer not being better. :)

                2. 8

                  I started working for a startup about 6 months ago, hired as the first (and still only) developer. I refuse to work beyond normal hours with any job, so I work 9-5 and take a walk at lunch. The founder has recently become very disturbed over the lack of deliverables. I think he expected that if he said “we need this sooner” I would work extra hours, or magically come up with something out of no where.

                  It obviously doesn’t work that way. My suggestion of hiring another full time employee has been shot down multiple times. We’re at a bit of an impasse there.

                  I think it’s important for people to understand that just because someone is writing code doesn’t mean they’re some sort of painting goblin that loves it so much, they’ll ONLY do that (and for less pay/free). I have a family and other interests. My life is not your company and it never will be.

                  1. 15

                    I’ve jokingly suggested in the past that I’d be willing to work more than 40 hours per week, but only if my compensation were increased in inverse proportion to the amount of free time remaining to me in the week (after sleep, work, commute, cooking, eating, housework, childcare, etc.)

                    Let’s say I make 150k for 40hrs/wk and have 20 remaining hours of free time per week. Going to 50 hours per week would mean 10 hours of free time (half as much), so instead of 150k×50÷40=187.5k, that would be 150k×20÷10=300k.

                    Pretty reasonable? :-) But I would never cut into my sleep, no matter what.

                    1. 8

                      I found that just charging the overtime already helps a lot. It’s one of the rare moments where charging by the hour has extremely helped me getting what I want.

                      The inverse proportion idea is neat. In a similar way, I always tell clients that my awake and my tired hours have the same price, they should pick the ones they want. (guess what: no one wants my tired ones)

                      1. 2

                        Haha, I love the awake vs. tired hours thing. :-D

                        1. 3

                          My pleasure :).

                          I got that from an enterprise client, who banned working over 8 hours per day with precisely that reasoning.

                      2. 1

                        I like your formula a lot.

                    2. 7

                      Nice article. This is a huge issue with hackathon culture today – people don’t realize how detrimental staying up for 48 hrs straight can be, for your health.

                      1. 15

                        Hackathon culture is often nothing more than blatant resource extraction of age and ability.

                        If you want to participate, be my guest, but at least see it for what it usually is, especially when it’s sponsored by corporate entities.

                        1. 5

                          Some hackathons, like those sponsored by your own company, might better be called “working for free”. Whichever manager came up with the idea for salaried workers to work extra hours build new prototypes on their own time was a genius.

                          1. 4

                            I don’t understand how corporations convinced people to participate.

                            Hackathons originated from open source projects Afaik. It makes sense if you only meet your collaborators for a few days once a year. I’m willing to spend that effort for a hobby but not for some company or promises.

                            1. 2

                              Spending appreciable time at any company will make clear flaws in process or technology. Many people who see these flaws will want to fix them. Some of them will take the opportunity to try (or at least draw attention to those flaws), even if it means working late.

                              That doesn’t make it right for companies to do this, but it makes it possible.

                              Personally, I much prefer the “2-3 days in a row during work hours” hackathon model for those situations – more people will participate, less pressure towards toxic work patterns – but I don’t run a company, so *shrug*.

                        2. 5

                          “if doctors (can) do it, why can’t we”. Answer: “because doctoring-culture is also fucked up and totally at odds with the evidence. God help you if you end up in someone’s care at the end of their shift; you’ll get vastly inferior care”. Doctors shouldn’t work more than 8 hour shifts either. In fact, for optimal care they shouldn’t work more than 4 hour shifts.

                          1. 4

                            I’ve been on flights where a previous delay would have caused the flight crew to go over their FAA flight duty limits on my flight and so there was a further delay while a fresh crew was brought in. A bit annoying, yes, but something I can also respect; I’m happier knowing that the pilots holding my life in their hands are well rested.

                            It’s too bad there aren’t similar rules for doctors.

                            1. 3

                              According to what I’ve read by John McPhee, the same rules apply to train drivers. He describes entire trains laded with coal stopping in the middle of Iowa to wait for a new driver.

                              Truck drivers have similar rules, but as they’re not supervised in the same way as pilots or train drivers there’s quite a lot of abuse of those limits.

                          2. 1

                            Do you have some sources about that? Or can you elaborate? I read all the time about how bad it is and I believe it but I’d like to know the specifics. I did that quite frequently over the last few months and I want to have a clearer idea of how much I’ve fucked myself over

                            1. 3

                              This is probably the best literature survey of the whole field of sleep deprivation.

                            2. 1

                              We run ‘hack days’ at work occasionally, where there may be several in a row. These are just in normal work hours, with the only difference between these and ‘normal’ work is that what’s being worked on is not planned (no scrum/kanban, not stories, no estimation) and doesn’t have to be related to the priorities the usual efforts are being directed towards.

                              These have been incredibly successful at helping us break through barriers, so we are trying to add more, swapping out some of the story-based working (which I see a place for but just isn’t efficient enough).

                            3. 5

                              This is why ageism bites you in the butt so many times over.

                              Anyone who’s been doing this for a while, especially those who are parents, know what’s important to work on and when to value our sleep.

                              1. 3

                                This is so true. When I don’t get at 8 to 9 hours of sleep I become grumpy, more withdrawn and less able to communicate properly. I can still crank out code, even when severely sleep-deprived. It will even be halfway decent (style-wise and maybe even functionally), but what I’m not able to do is think big-picture about things.

                                That means the code is going to suck and I’ll end up working more hours getting less done because I’m overly focused on “fixing this stupid little piece of code” while I should be refactoring or reconsidering the design.

                                1. 1

                                  Obligatory mention of the highly useful compendium on sleep by Piotr Wozniak: Good Sleep, Good Learning, Good Life. I am the sort of person who needs to understand the mechanics behind things to really do something useful with knowledge, and Wozniak’s compendium is very helpful in that regard.

                                  1. 0

                                    I kinda expected the story about “sleeping through a storm” [0], something about either monitoring, automated recovery, circuit-breaker-type stuff, restart strategies, hot standby, failover, blue-green deployments, regular backup restores, or something.

                                    But I also like talking about sleep! I really feel like my sleep improved after I got a 3” latex mattress topper. Waking up got better, too, after I set a lamp on a timer to come on just before my alarm. Doing cardio seems to lead to more solid sleep, but I’m not real sure.

                                    [0]: a short story from Have a Little Faith, by Mitch Albom