开源日报 每天推荐一个 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/