Writing code is like meditation: What kind of programmer are you?

Source: Internet
Author: User

Writing code is like meditation: What kind of programmer are you?

Original article from: Are you a Zen coder or distraction-junkie?

What do you do when compilation takes up your time. What do you do during this time, even if you wait for a short period of computer operation to end?

This time is insignificant compared to your workday break, but in general it can bring great help to your productivity and happiness.

By the way, this articleArticleThe content is not only for developers andProgram. It works for smart people who use computers. An attachment will be added later. Now let's get started!

Why write this article?

I recently used some time management skills in my work habits to improve my productivity, reduce stress, and help my body and brain rest. I basically want to work in a minute or two without being disturbed, and then take a 20-30 minute break.

However, I almost immediately entered a huge problem: When I was compiling or deploying something, I would automatically open the mail client, Facebook, and news reader, one or several of the news sites. This is a bad habit. It is hard to get rid. It disrupts my focus.

So I decided to search for relevant materials. Stackexchange has a Forum on "what should be done during compilation. The answer to the most votes is "less Compilation Time. However, these answers cannot solve more common problems: when working on a computer, there are always some issues that need time to wait.

In contrast, most people on the forum suggest what they can do at that time (similar to sending and receiving emails or reading news), which is a bad idea. A good suggestion is: "It is not good to do multiple things at the same time ". I agree with this. But what about other people? Don't think? Okay. This answer is disappointing. So in this article, I will explore this issue in depth and show you the best way.

Two types of programmers

There are two types of extreme prototype programmers-"Zen programmers", which we call hard-pressed programmers, and "programmers who cannot restrain their distractions", which we call a restless programmer. Both are extremely extreme, so they should be at either end of the bell-shaped curve, right?

Error. As a matter of fact, a restless programmer is incredibly ubiquitous.

Image effects are more useful than text, so I now use pictures to illustrate the status of the two spiritual worlds of programmers.

A cool programmer

What will programmers do?

He wroteCode. This is the only thing he did, and it also shows everything. Perhaps the more important question is what he did not do: he was not distracted. Focus on attention, focus on changes, and focus on coding. One to two hours of pure code time, then 20-30 minutes of rest, usually left the computer. Then he starts to write the code. (The time mentioned above is just an example. He can schedule the time in other ways-but he can always balance and achieve long-term productivity .)

His thinking flows slowly like calm water. Of course, it is not like the constant frozen ice.

This is what the programmer's spiritual world looks like:

 

A restless programmer

Even if your spiritual world now looks like a well-intentioned programmer, you can just open Facebook or check your email or do something else at compilation. In a few minutes it will look like this:

 

Ladies and gentlemen, this is your situation after checking your email and opening Facebook. If you still have a bunch of real-time notifications, instant messaging, and check your RSS feeds and tweets, the result is that the brain is like a fragment disaster shown above.

You may not have completely recovered from this image. It may not happen at any time on a specific day. Even if you minimize all useless things in the spiritual world to the taskbar, it will stay there and keep tempting you and consuming your spiritual resources. Friend, it's time to leave. You will be confused about how it disappeared.

By the way, if you are a confused person, you can still look at the webpage comics on our website! You don't have to come back and read this article immediately. Don't forget to subscribe to that cartoon source! After reading all the comics, you can share them with your friends and chat! It's not too distracting to do these things, really!

What is the difference between a restless programmer and a restless programmer?

Programmers are more inclined to have long-term happiness and productivity. He has the ability to focus highly on his goals.

A restless programmer is more inclined to be satisfied for a short period of time, so that he cannot reach all his potential and will bring both physical and mental harm to himself. He cannot concentrate.

To fully understand this, we need to first understand how our brain works.

How does our brain work?

In fact, we cannot fully understand it. However, based on our existing understanding, psychologists have come up with some useful analogy methods to help us understand complicated things.

Computer analogy

Your brain is like a computer. Of course, it is much more complicated than a personal computer, but the computer metaphor allows us to describe many processes running in the brain. Some things are like hard disks, some things are like memory and central processor, as well as processes and threads. They do need some time to access information and compute data.

Obviously, our brain has a certain amount of capacity to focus at any time. You can concentrate on a certain thing or a few things, but you cannot do either. Turning attention from one task to another may even affect cognitive ability, especially for two unrelated tasks.

As long as you focus your consciousness on something, it will take some time to process it and the resources it allocates and initialize it from the memory and background processes. It can exist for several hours or even days. Things that have recently been noticed will appear constantly at any time. In real time, you don't notice that they are flowing in your brain, and they are always there-and they occupy resources, so you don't have to concentrate.

Drawer analogy

Another useful analogy is the drawer in the cupboard. Your brain is like a drawer for storing things. Each drawer has data and is connected to each other based on a certain context and concept. In a specific period of time, some drawers are opened and some are closed. The opened drawers represent your current space, which is easy to access.

The main problem is that it takes a long time to close the drawers, and opening them is very fast.

So when you are at work, you turn your attention to a new place and it will immediately open a pile of drawers. When you get back to work, those drawers are still open. The only advantage of this is that it can improve your creativity and brainstorming-but the unwanted Drawer Opening will have an impact. They suppress left-brain thinking and reduce attention.

What should I do during compilation?

When you are waiting for the computer to perform operations, you can determine whether you are a calm programmer or a confused programmer.

The main comments are:

1. Do not be distracted

2. short rest

It's not that difficult to stay focused-you have to cut off the power of your brain or stay focused on your code. However, disabling the brain works better. This will enter a micro-meditation state, which will remain valid after a short break.

Why do you want to go to meditation? Okay, your brain is chewing code every day. Why don't you give it a break? In addition, meditation science has been proven to continuously increase the level of happiness. Imagine the long-term advantage of two 30-60 stopwatches each day for seemingly unimportant meditation.

What should I do for a short break? Select everything from the following content and combine them according to your ideas. You can repeat them all in this order, depending on (or not) the time required for these actions.

1. Stand up

2. view the distance

3. Put your hands behind your head, leaning against the chair

4. Stretch your legs and raise your hands as high as possible

5. Close your eyes

6. Rub your eyes

7. Slowly turn your head in all directions and stretch the cervical spine

8. Close your eyes and take a deep breath.

9. Pour a cup of water (Be careful not to be distracted by colleagues on the Road)

You can also do things that involve your major body and do not affect your thinking-static exercises, magic tricks, duel, haha.

By the way, if your boss doesn't give you enough time to do anything above, I suggest you read this article. It is much better to restore your mind faster and stay focused than to see that your work is actually distracting and quickly tired.

Stretching and relaxation are very beneficial. The last time I saw my physiotherapist, she found my shoulders tight. She told me that it may be because I sat in front of a computer and my hands were always bent, so my muscles were short and I couldn't work hard. What should I do best? Raise my hands and try to raise them to the highest. This is what I often do when compiling or waiting for the computer to perform operations.

You may have heard that it is a good idea to regularly relax and take a short break when you are using a computer. The question is how to do it-even if you set a timer, what if you are in a complicated situation and are half done? In this way, it cannot be implemented. However, if you take a short break during compilation, you can do it well. You can even make it a habit and make it more "natural "! Now compilation starts to remind you to relax. This is incredible.

What you should not do during compilation

In fact, I want to click my homepage to make things easier. Here is a list of things you should not do during compilation. Think in this way: these things not only make you unable to concentrate, but also make your mind and body not take a short rest.

1. Read your RSS Feed

2. Read the News (any news)

3. send and receive emails

4. Browse various social media (Facebook, Twitter, Google +, LinkedIn, Reddit)

5. Watch the video

It is better to do the following two things than above, but it is still not recommended:

1. Chat with colleagues

2. Read a physics book

Focus on changes and focus on changes

I am about to end this article, the Zen programmer, the ideal method of my daily workflow.

The key to productivity and efficiency is to focus 100% on what you are doing now, and then fully focus on other places after you finish. Attention from one thing to the next thing cannot be dragged.

Divide your work time into 1-2 hours. Attention 100% is concentrated in these time periods. Then there is a 20-30 minute break, and everything can be done. During off time, you can browse your emails and social media. Of course, it would be better to take some healthy snacks in a break. After the rest, check what is next in the task management software (for example, I am using my swift to-do list) and start another work that requires attention. To a large extent, this is a bit similar to the tomato work method.

You can choose not to take a break. Do not skip it. Your body needs to rest. Even if you are doing your favorite job, you also need to take a break-in this case, you will have the motivation to do more things in the next period.

Your workflow should look like this:

(Task 1-Task 2)-rest-(Task 2-Task 3-Task 4)-rest-(another period of 1-2 hours)-rest ......

Don't let it be done in such a chaotic and random way that makes it hard to see:

Task 1-email-Task 1-Facebook-Task 1-Task 2-short break-Facebook-Task 2-email-Reddit-Task 3-email-rest-Task 2-email- task 3-Twitter-Hacker News-Twitter-Task 1-Task 3-rest-Task 4

If your workflow is like the above, you cannot completely relax or finish what you can do. This is the lowest level method. This will not only waste your potential and time, but also make you feel unwell for a long time.

I don't want to lie. It's really not easy to concentrate. It is very difficult, because when you are not focused, you will basically move in the opposite direction. Habits and deep-rooted practices are as hard to change as subconscious.

The good news is that you can also practice. You can learn how to concentrate. This is a skill that everyone can learn, and it is very useful and worth your efforts.

-- Reproduced in jsiri Novotny +, the author is troubled by the Windows platform task management software. He posted this user article to componentowl.com because its swift to-do list uses the better listview based on the. NET Framework on Component owl as its core component.

Appendix: Do you have people around you who want to check 50 emails a day? Send this article to him. He will thank you later.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.