開源日報 每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,堅持閱讀《開源日報》,保持每日學習的好習慣。
今日推薦開源項目:《向公司提問 reverse-interview-zh》
今日推薦英文原文:《How to Get in the Perfect Mood for Coding》

今日推薦開源項目:《向公司提問 reverse-interview-zh》傳送門:項目鏈接
推薦理由:求職是一個雙向選擇的公司,公司選擇了你的同時,你自然也要選擇公司。這個項目收集了許多你在面試最後可以向面試官提的問題,這個環節是讓你了解這家公司的大好機會,你可以得到很多平時難以接觸的公司信息。想一想,如果真的通過了一家並不合適自己的公司,接下來的一段日子自然不會太好過……
今日推薦英文原文:《How to Get in the Perfect Mood for Coding》作者:Piero Borrelli
原文鏈接:https://medium.com/better-programming/how-to-get-in-the-perfect-mood-for-coding-21173dd084d
推薦理由:一些能夠保持更好狀態進行編碼工作的策略

How to Get in the Perfect Mood for Coding

Improve your productivity with these emotional tips

Sitting in front of a computer and 「just code」 is not always that easy. We are humans too, with worry days and tired mornings. Programming is such an emotional game to win. You have to control yourself to disclose your concentration abilities and get the job done.

Think about all you』re asking yourself for when you』re doing it:
  • Study a problem and ideate a solution for it.
  • Manage DRY principles, maintenance, scalability and simplicity.
  • Try not to get distracted when you have Google ready to answer any dumb questions you might have at that moment.
  • Work under the pressure of an incoming deadline.
Coding is a mental game too. And you should care about being in an appropriate mood for it. So that your days can be productive.

Here』s a list of my advice for reaching such a mood and getting the most out of your days.

Get Rid of Worry Code

This one is probably what, especially in this period, might affect you more. When you』re worried or when you feel bad. You could have so many thoughts raging in your mind and you can』t get your hands on the keyboard. You could be thinking about your loved ones, life situations, retracing dialogues from the inside.

For how cynical that could sound, this is going to kill your productivity. Which will probably give you some problems with your boss in the long run if you can』t keep these feelings away while working.

My solution, which might work for you in this case, is divided into two main steps:
  • I think about what the problem is and what my need is. Do I need to get reassured by a special person after an argument? Do I need to call my mother to make sure she』s okay?
  • I will take 20 minutes away from code, acting based on that need, trying to satisfy it. So if I need reassurance after an argument, I will talk to that person. If I need to talk with my mum, I will call her and make sure she』s alright.
This should help you, or at least satisfy your inner emotional hunger for the day. After which you might want to consider deeply working on the problem to make sure you』re worry-free the next time you have to code.

Chill with Music

For some people, music does wonders while coding. They could listen to heavy metal while still being concentrated on a task. To me, that』s not the case. As soon as I』m listening to a cool song, my mind's attention just gets stolen by the lyrics and rhythms. In fact, I can only listen to it while doing repetitive tasks which are pretty mechanical to me.

If music is for you and puts you in the good mood without distractions, I suggest you listen to it whatever genre you like and can stand for a prolonged time. However, I still recommend you choose something chill, as I find it can calm your mind and put you in the perfect position to deal with lines of code.

Here are some cool tips for some chill stuff I love, ranging from lo-fi to some chill hip-hop.
https://www.youtube.com/watch?v=5qap5aO4i9A
https://www.youtube.com/watch?v=InI8TdggKd0
https://www.youtube.com/watch?v=f02mOEt11OQ

Avoid Interruptions

You need to always have in mind what you』re doing and your next step while coding. Affording a distraction means losing track of your work, subsequently spending a lot more time to recap everything you were doing.

I find the most interruptions come either from letting myself being carried away by Google, looking for stuff I need or interesting articles or simply outside noise.

In the first case, the only solution is to be disciplined enough to not start surfing the web randomly when tempted. Make a list of things you want to check out in the morning and then come back to them later when you have some free time. You can further encourage this behaviour with some time managing techniques like the Pomodoro one.

For noise isolation, the best purchase you can do as a developer is a good quality set of noise-cancelling headphones. Their price can range up to quite a few bucks, but I』m confident you can find some good ones also on the cheap side.

Kill Boredom

Do you ever find yourself just staring at the keyboard feeling blocked? Like if your brain went into a freezing mode. It can happen after a long day of typing. In this case, my suggestion is you find an interesting external input to bring creative inputs back. The best thing you can do is to find a pair partner. Ask your colleague for help on the task you』re working on. This will surely liven up your mood and give you a boost on productivity for a while.

Save Your Brain From Burning

Sometimes you just can』t sit another second trying to solve a damn problem you』ve been struggling with for the last four hours. You start even forgetting what the initial issue was, mumbling while you go through your code making stupid errors one after the other.

This is the sign of a good time for a break. In this case, I suggest you take 20 minutes away from the keyboard to avoid the temptation of going back to the problem with a brain still overflowing. You can still be in front of a screen, just not the one of your laptop.

In such cases, I like to chill in my office coffee room (or living room when working from home) and just enjoy a little snack. I will watch a couple of YouTube videos and then get back to my job with a fresh mind.

Key Takeaways

  • To find the best mood while coding, you have to implement a series of ideal strategies.
  • If being worried about something is incapacitating you from writing code, take 20 minutes away from the keyboard and try to fulfill your emotional needs at least for the day.
  • Chill with some good music while coding, as it might help you bring in a positive mood.
  • When bored or having writer』s block find a pair partner!
  • Buy yourself a good pair of noise-cancelling headphones and discover a time-managing technique that works for you.

Conclusion

Programming is already hard by itself. Plus, we always have to find new ways to control our minds, the most important tool we have, to concentrate and be productive. The tricks and scenarios I proposed to you should help you to know how to reach an optimal mood for coding and how to deal with different situations.
下載開源日報APP:https://openingsource.org/2579/
加入我們:https://openingsource.org/about/join/
關注我們:https://openingsource.org/about/love/