今日推荐英文原文：《Programmers: You Snooze, You Win》
推荐理由：说到 Python，现在这语言应该已经流行到家喻户晓的程度了，而今年的 PyCon China 2019，则是一个为了庆祝 Python 诞生三十周年的活动。这个活动在上海的主会场结束后，还将在南宁成都等全国各地设立分会场，让来自五湖四海的 Python 开发者能共同交流。这个项目则是在会议中使用的资源合集，现在已有的是在主会场上海使用的幻灯片，后续还将有演讲视频上传，感兴趣的朋友可以关注一下。
今日推荐英文原文：《Programmers: You Snooze, You Win》作者：Huseyin Polat Yuruk
Programmers: You Snooze, You Win
Sleep is a superpower, don’t ignore itCaffeine: The ultimate fuel of a programmer.
Energy drinks and coffee: A programmer’s best friends.
They’re always on the programmer’s desk and they never leave us alone. They help us with our programming journey. They provide us the boost we need to be better programmers.
Deadline’s Coming…And you’re still behind schedule. You need more time to complete all your tasks. You need to write more and more code. You have to be awake even at night. You have to sacrifice your sleep for programming. You think if you can find more time, you can do a better job and meet the deadline.
11:30 P.M.You’re a bit sleepy. Your body is telling you to sleep—but you have to stay awake. You need your ultimate fuel. Let’s drink coffee. Oh, you feel much better. Caffeine provided you the two more hours you needed.
There are still 10 bugs that you have to fix. You’re running low on fuel again… Let’s drink an energy drink so that you can still keep coding.
You committed your code to source control. You felt relieved. You were productive. You completed all tasks assigned to you. As a bonus, you believe that other programmers in your team now think you’re a hard worker. You’re a great programmer! Even into the wee morning hours, you committed code to source control.
8:00 A.M.The phone rings. It’s your teammate—there are now new bugs in the software after your late-night code commit. How could that be possible? There were 10 bugs you needed to deal with. You fixed them all, or so you thought. Why are there new ones now? What went wrong? You did everything according to plan. You were just like those programmers in Hollywood movies. Coffee, energy drinks, all-nighters…
You Did Everything Right. So What Went Wrong?Let me tell you what went wrong.
You were misled by those imaginary programmers in Hollywood movies. You’ve believed something wrong your entire career: That the more hours you’re awake, the more code you write. The more code you write, the more productive you are. Sleep is just a small thing that you can sacrifice to become a hard-working programmer.
But what about your health? What if there was another option to be more productive, to be a better programmer?
You Snooze, You WinI have great news for you!
Scientists have discovered a revolutionary new treatment that makes you live longer. It makes you healthier. It enhances your memory. It makes you more productive and more creative. In the end, it makes you a better programmer.
Are you interested?
While it may sound hyperbolic, nothing about this fictitious advertisement is inaccurate. If it were for a new drug, people would consider it beyond belief. Those who were convinced would pay large sums of money for even the smallest dose. Of course, this “ad” is not describing some miracle new tincture or a cure-all wonder drug—but rather, the proven benefits of a full night’s sleep.
The evidence supporting these claims has been documented in more than 17,000 well-scrutinized scientific reports to date. As for the prescription cost, well, there isn’t one. It’s free. Yet all too often, we shun the nightly invitation to receive our full dose of this all-natural remedy, with terrible consequences.
Yes, my friend. The right answer was right in front of you all along—or rather, it was in your bed. As you may recall me mentioning before, sleep enhances your memory. It prepares your brain to learn new things. Experiments show that sleep deprivation affects your ability to learn. The less you sleep, the weaker your memory becomes. After being awake for 16 hours, your brain starts to fail. If you want to perform, you should get 7–8 hours of sleep every day.
What Does the Research Say?According to researchers, your sleep quality and stress level matter far, far more than the practices you follow. Nothing else comes close: not Clean Code, not choice of language, not Test-Driven Development; nothing.
But the evidence for the importance of sleep is overwhelming.
For instance, take a look at the results of this study on the impact of a night of sleep on the performance of novice developers.
The researchers recruited 45 undergraduates and asked them to tackle a programming task. Among the participants, 23 agreed to stay awake the night before, while 22 slept normally. Here is what they found:
One night of sleep deprivation is detrimental for software developers. In particular, sleep-deprived developers produce software of lower quality.Another study found that getting less than 7 hours of sleep causes dramatic degradation on all measures of cognitive performance.
What about overwork? Remember all those sleepless nights you thought would make you more productive?
Turns out, after 8–10 weeks of 50-hour workweeks, you’re less productive per week than someone who worked 40 hours.
Do you want more evidence? I strongly recommend you read “Why We Sleep.” This book covers many scientific facts about sleep and was my inspiration for writing this article.
No programming language, tool, technique, or method matters nearly as much as the condition of our own minds. If you want to be a better programmer, if you want to write good code, be human. Be healthy. Nothing else comes close.