開源日報 每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,堅持閱讀《開源日報》,保持每日學習的好習慣。
今日推薦開源項目:《慶生 2019-Slides》
今日推薦英文原文:《Programmers: You Snooze, You Win》

今日推薦開源項目:《慶生 2019-Slides》傳送門:GitHub鏈接
推薦理由:說到 Python,現在這語言應該已經流行到家喻戶曉的程度了,而今年的 PyCon China 2019,則是一個為了慶祝 Python 誕生三十周年的活動。這個活動在上海的主會場結束後,還將在南寧成都等全國各地設立分會場,讓來自五湖四海的 Python 開發者能共同交流。這個項目則是在會議中使用的資源合集,現在已有的是在主會場上海使用的幻燈片,後續還將有演講視頻上傳,感興趣的朋友可以關注一下。
今日推薦英文原文:《Programmers: You Snooze, You Win》作者:Huseyin Polat Yuruk
原文鏈接:https://medium.com/better-programming/programmers-you-snooze-you-win-59fd37ccec3b
推薦理由:以良好的狀態進行工作比狀態底下時的工作更有效率,也更健康

Programmers: You Snooze, You Win

Sleep is a superpower, don』t ignore it

Caffeine: 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.

Right?

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 Win

I 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.
下載開源日報APP:https://openingsource.org/2579/
加入我們:https://openingsource.org/about/join/
關注我們:https://openingsource.org/about/love/