Ding Jie Yang
---- Chatting about programming ideas
Author: HolyFire
After years of programming, I found that the idea of programming is crucial to a programmer. Once I got a question, I immediately began to consider how to use code to implement it, as a result, I was so excited that I was excited every time I had done it. I edited and found out the shortcomings. I didn't take it into account, so I completed a small program in an exceptionally bad way. At that time, I felt like I completed the whole world, maybe that era is my greatest pleasure.
After completing four or five programs, I began to find that I had done a lot of repetitive work, so I began to develop my library and functional modules. I think that once I write these modules, I will be able to use them. Maybe I am smart in that era.
When I wrote 5000 or 6000 lines of code, I found that the functional modules I wrote were not clear about what they did, and I was used to using modules better than others, I began to get confused about what I did. At this time, I began to study other people's code and began to understand what is optimization, what is data structure, what is mathematical modeling, and I began to study application mathematics and software engineering. At this time, I began to use C ++ to write programs using classes. Maybe I was wise at that time.
When I wrote 40 or 50 *. h and *. cpp, I began to find that the classes I wrote were not generic at all and could not be reused. I started to study classes and object-oriented objects in depth and understood inheritance and encapsulation. At this time, I began to think deeply about what is important. So I began to analyze the problem rather than compile the code as soon as I got started. Maybe I used to be a fool ^_^.
I spent more than three years Wasting my youth doing things that others only need for a year (of course, the experience I have accumulated in three years cannot be achieved in one year, but I have wasted too much time on programming.) If you don't realize this, you may also waste a lot of time.
Analytical skills are an important attribute for a programmer. They are directly related to your understanding and organizational skills in things, what programmers do is to break things into mathematical elements and re-organize them in the computer to reproduce them. Therefore, how to deal with things is a key point.
When we understand and describe a thing, we usually first process part of it, then process another part, and then wait until all parts are processed, the specific things are reproduced. For example, if you introduce a goat to a person who does not know it, if you say it to him that it is a goat, he will not understand it in any way. If you say that a goat has two horns and a short tail on its head with four legs, then it will be blurred in its mind, if you add a fluffy hair, a funny beard, or a grass-eater, at least it will not be confused with the oX. If you can describe more details, then he knew what the goat looked like. When he saw the goat, he knew it immediately. You do not need to describe anything about computers, but if someone else or a few years later you can understand your documents, the detailed description is required. From the above process, it is a good way to divide things into small pieces. We call this process division. Of course, the Division can continue, and the small parts can continue until they cannot be divided. Of course, to divide a goat, you need a person who has a comprehensive understanding of the goat, so you should have a comprehensive understanding of the problem when dividing your question. It seems that this is a contradiction for a person who has not yet understood this problem. Dividing a thing helps to understand this thing, but a good division requires a full understanding of it. So we need to change our practices. First, let's take a rough look at the problem, then roughly divide it, then roughly understand the modules, and then roughly divide it into small pieces that cannot be divided, let's organize it again. At this time, we have a comprehensive understanding of the problem. At this time, we will discard the duplicate part of the small part (usually there will be a duplicate part), and then combine the small parts again, think about combining a goat with eight pieces of meat. Haha, it must have been unable to live, but it is good to have mutton. If you combine it smoothly, it means that you have well divided the problem and understood it thoroughly, and the future will be smooth sailing, your head is full of solutions to this problem. Don't worry. Smart People will carefully read the division process several times and try several methods of restructuring. This will not only benefit future programming, but also serve as the starting point for better solutions.