Know what to do when a programmer can't write code?

You have been facing the computer for n hours. Don't know what code to write, or an urge to throw the keyboard is brewing in your chest.

Coffee cup after cup. I didn't dare to drink any more, because there might be side effects, my heart beats faster, my body trembles involuntarily, cold sweats, but I still can't produce any code.

All efforts to rediscover the fun of programming are in vain, because your last bit of energy is used to expel the words in your brain that are siege:

“我写不出代码了”!

Insert picture description here

The essence of programming is tricky

Even the best programmers encounter unsolvable software engineering problems. Encountering such a problem does not necessarily mean that you lack skills or knowledge.

Programming is not an easy job. We can maintain the level of productivity you want by taking unorthodox methods and ensure that high-quality code is submitted.

If I spend a few hours on a problem and still can't find a solution, I will end up feeling that this is a waste of time. I'm not talking nonsense-I just feel that "no one can die without regret".

There is no anger or sadness. Because I have tried all directions, but I just couldn't get through. Lost hope, so I began to want to quit. I think I should change my job, be a bartender or something else, at least researching and testing what to add to the beer will not take me several hours.

These are my thoughts when not typing code. I began to doubt life, doubt coding, doubt life.

Is it effective? Well, I have never heard any expert say that "resignation and malaise" can make great code, so it may not be effective.

This raises the question: How can we avoid this ineffective state?

Rediscover the problem, rediscover your productivity

Maybe you are already on this road. Then you can just continue at this time, I may not have anything new to tell you.

If you are a novice, then you may not know how to rediscover productivity.

The content I want to share below will help you maintain productivity in a healthy way while programming, without getting exhausted. mainly includes:

  • Test different solutions until it feels repeated

  • Find open source solutions online

  • Ask more experienced programmers

  • If everything fails, let go

1-Test different solutions until it feels repeated

Before you research or ask other developers (=wasting their time), you should try to use your existing knowledge and thinking to develop every possible solution.

It is obvious that too many programmers start by asking others, and they never even settle down to analyze the problem itself. Don't be such a nuisance, and try not to waste other people's time.

Throw yourself into work first, then ask for help.

2-Find open source code online

When you devote yourself to work, but no results, then you can try open source code in the next step. Many programmers build software out of the pleasure of creating solutions and publishing them online for everyone to use. Some people publish code that was used by their programmers in commercial projects.

GitHub is one of the two main places to find open source code. The other is StackOverflow.

The solutions for these websites are in the form of reusable code, which is convenient for you to implement in your project.

Remember, using code developed by others is always risky. It may change the behavior of the program in unexpected ways. Back up the original code, this is common sense.

3-Ask more experienced programmers

Have you ever encountered a situation like this, when you ask other people for help only to find that you don't even know what you are asking?

Before asking anyone, you have to be prepared for some questions that you cannot answer through online information searches.

Only clear problems can have clear solutions. If it is a problem that you describe yourself in the cloud-then you will only get an answer in the cloud (and may annoy others).

If there is no developer around you to ask, you can also find it online. You can ask on StackOverflow or MSDN social forums, or find a Slack channel specifically for your technology.

4 – If everything fails, let go
Insert picture description here

Don't be stuck in a dead end, if it doesn't work, do something else-sleep, eat, etc.

Do you think this is avoiding work? That would be wrong.

What I want to tell you is that when you are at its most relaxed, it is often when the solution comes to light. This is not my random fabrication, but scientific proof. At this point your brain is working in a "divergent thinking" mode, not in a "focused" mode-you can understand the difference in this article.

In general, this idea is to forget the problem at hand and let your mind and soul immerse in other things. At this point, your subconscious mind begins to connect the main points and move forward in the direction of epiphany.

What can we do to help the brain work in divergent thinking mode? Just relax:

  • Walking (Ancient philosophers were very used to speaking while walking because they realized that walking helps thinking)

  • Clean up the office or residence (give yourself a reward after completion)

  • Date friends, have a cup of coffee, and gossip (if you are too concerned about the problem, then it is recommended to talk to a non-coding person who can’t help)

to sum up

I maintain a healthy balance between programming and life.

Whether you choose programming for hobbies, money, or a grand cause of changing the world-programming shouldn't be the only thing you are obsessed with, otherwise you will become crazy.

Finally, if you rack your brains but still cannot solve the problem, you might as well put it aside. Through the operation of the subconscious mind, perhaps breakthrough ideas will emerge suddenly.

Recommend good articles:

How do automated testing practitioners choose jobs? What is the future career development?

The basics of automated testing, everything you know and not know is here!

A pack of sad spicy strips to share-top ten best automated testing tools

About software testing! Everything you want to know is here, Xiaobai must see!

What you need to know before doing automated testing

10 years of software testing engineers' perceptions-to friends who are still confused

What kind of person is suitable for software testing?

Knowledge to understand python automated testing(3)

Which is more suitable for automated testing, Python or Java?

The daily work of software testers

Play with Python+Selenium automated testing in 10 minutes, and teach you a quick start!

Here I recommend an architecture learning exchange group to everyone. Communication learning group number: 313782132 Some video recordings recorded by senior architects will be shared: Spring, MyBatis, Netty source code analysis, principles of high concurrency, high performance, distributed, microservice architecture, JVM performance optimization, distributed architecture, etc. These become the necessary knowledge systems for architects.

Guess you like

Origin blog.csdn.net/weixin_50271247/article/details/108523046