[Turn] How to solve the problem of unable to write code

1. First analyze the idea of ​​implementation

Get the homework, according to the function to be implemented, first analyze the idea of ​​implementation.
If you don't know how to implement it at all, and you are at a loss, it is best to see how other personnel are implemented, or discuss it with your teacher or classmates.
The point is to find a solution to the problem and to clarify the idea of ​​implementation.
If you can come up with a few steps, record them first, and then repeat the steps above.

2. Analyze and record the realization ideas.

When analyzing and implementing ideas, write them out while analyzing them, write them in Chinese, and write them in detail.

If you write it in the programming tool, write it directly as a comment, for example:
the first step is to do the above
1.1 what to do
, 1.2 to do the
second step is to do the above
2.1 to do what
2.2 to do
.. . and so on


When encountering a place that cannot be written down, first check whether there is no idea or the previous idea is not clear
. If there is no idea, please refer to the first treatment.
If the previous thinking is not clear, then come back and re-think, be sure to consider it clearly.
This is actually an added benefit of this method, which is that it forces you to think and think carefully.

3. Write the implementation code

If the ideas are sorted out clearly and the steps to realize the ideas are sorted out, then writing code at this time
is almost a translation process, which is easy to implement.
It doesn't matter if you only have a few steps to think clearly, write as much code as you think, and take your time.

4. Solutions that have ideas but can't write code

This situation often occurs in beginners, mainly because the code is written less. ( In this case, you need to practice 200 to 300 lines of code every day .) It is
recommended to look at how others write and accumulate code writing methods. It doesn’t matter if you don’t write it this time.
I have seen it once, next time I will write nine, it will add up to more, the more I write, the more I can achieve.

5. The method is not necessarily copied, it can be used alternatively

For example, it is also possible to write code while analyzing and writing ideas, as long as it can help you think.

6. Can't write code

When most people can't write code, it's not that they can't write it at all, or they can't write it at all. Please try to write what you know and can write first, and practice more according to the methods introduced in this article. To the qualitative change, you will soon be able to write the implementation code yourself.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325556183&siteId=291194637