Your brain needs to have a programming mind. __ Programming

Source: Internet
Author: User

your brain needs to have a programming mindset.

2009-10-16 13:22 5637 People read comments (89) Collection Report

Author: such as Peng Net 59362008 original post address: http://www.rupeng.com/forum/thread-4811-1-1.html

This article, is written to enter the gate of the programming but suddenly found that in addition to the passion of the remaining are confused novice, please keep your passion, that is the most pure power.
Also hope that you in the future learning process, can not detours. Remember, opportunities are always there, but you have to hold on to them first.


A pair of scissors in some hands, he can only a perfect paper cut to pieces, but in the hands of paper-cut artists, but can wonderfully cut out the incomparable window grilles,
The scissors is the programming language (not just C), the paper-cut artist is like a master programmer of Enlightenment, and the unfortunate poor person, is not aware of their situation of the people (is not you.) )

-------think about how long it takes you to learn to use scissors. -------
A man asked me how long it would take to learn a language. , I gave him an answer, that is, I learned C language used time, 3 days. (I study mechanical, learning C is totally hobby)
The first day, to the Xinhua bookstore to buy a "C language programming", go home, put on the bed, and then play cf.
The next day, I read the catalogue and the editor's message. Continue cf.
The third day, read the whole book page by page. and took notes. I am how to learn C language.

This is my whole process of learning C language. Someone smiled,
OK, now you ask me about C, what int is. What the pointer is. I can accurately answer you, if you ask again, the book of the Nottingham Tower problem without recursion how to solve. How to write an attempt software.
I replied, I won't.
You don't say you're going to C already. I asked, did you ask the question of C? These problems can only be solved in C. It's obvious, no.
For example, or above, everyone knows the structure of scissors, will use scissors, but not everyone can cut off the perfect window.
You asked what int is.  What the pointer is. It's like asking me what the scissors are made of. Who doesn't know that. But you asked me if you could write a view software. It's like asking me,
Can you cut the window-bars? Of course I answered, No.
Learn C language, as long as the basic grammar understand, understand the meaning of the keyword is OK, even do not have to remember it. It will not be lost, it is in the book, forget to go to see the line. How to learn C language. That's how you learn.
C (programming language) is just a tool. It's like a pair of scissors. Scissors are for use, not for research, but unfortunately, a lot of people are still studying scissors today.
I finally have to learn the method, not C itself. Learning C itself is only a very small phase.


------How you picked things up with scissors. -----
The man asked me again why I read all the examples. I can't write a program. Don't know how to do it.
For example, very good, you will use scissors, the following follow the master step-by-step to cut the window, the master cut, you also cut the finished. Then the master said, you cut another one for me to see. You were suddenly blindfolded, forgetting that the master was from the entrance of the knife. Can't grasp the key point of the problem. Algorithms are not designed at all.
The program on the book is easy to read. This is the author's intention to do so, but his real purpose is not to let you read the program. It's about letting you learn his way. What method. Find the way to get to the point. (is to analyze where to start, how to design the algorithm after this method)
The answer to every example in the book must be preceded by the phrase "We can do this ...", "doing this" is the whole process of the author's thinking, but also the author to find the whole process of cut-in point. Did you notice when you were reading? This is more reading.
If you think that way, then you know half of the problem, and why the other half. Yes, just to write the program. That's just doing more.
Can find the cut-in point, also can draw the N-S chart, below goes crazy to write the program. Over time, you will find that when a problem is placed in front of me, I have a feeling that he can be solved.
This feeling is the starting point for you to solve the problem.


-----What you cut with the scissors. ------
The man asked again (always he--. I also write a program and ask what always goes wrong. Or a problem solved, suddenly found a new problem emerged.
Or the above example, some people cut the window is really good-looking, but some people cut out and ... Let's call it a window-bar. Why the gap is so big.
The same problem, others write the program concise, efficient. Why I write so long, like "build" the Great Wall.
Look back and see what you've done with the second question. Read more questions, do more questions, yes.

But what you are looking at is the problem.
Do you understand who is the program in front of you?
Many classical programs can be found on the web, but the "classics" of these programs are often specific to certain aspects. That aspect of his problem. is the classical algorithm, but the format, often not "classic."
For example, when you write a program, you will also use int i;? If used, it is that you do not have a good style, habits. The definition must have an actual name. This can reduce the burden of your thinking, if I represent the sum, you should write int sum;
Of course, there are code to write specifications, should pay attention to. (This will not cause grammatical errors or writing errors because of your negligence)
What is the program.
For example, you are doing a question for 1+3+5+7+ ....  Well, solved, and then, you picked up another question began to 2+4+6+8 ... - -。
You are also working on the problem, but you have been doing nothing. To learn to extrapolate, big save their time and energy, programming is very hard. There is not so much time to waste. Borrow like Peng net words is Itong.


What are you thinking when you are looking at the problem?
When you get a few classic programs and read them out. Look over your shoulder and think about what you got from it. As you read the topic in the textbook, do you notice the thought process written by the author in front of the example?
Now, without the author's thought process for you to read, you have to understand, to feel, to try to imagine yourself as the author of the program, if it is me, what I will do, the author has to do, ask what to do.
For some people, it's a painful process. But for some people, it's fun. It depends on what you think.
How do you do the problem?
See a lot of programs, see a lot of classics, when you start to solve a problem, you have to apply these classics. Or have you ever thought of using these classics.
Can you find a more classical algorithm than this one?
This is the ability of the individual, not simply to do the problem, see the problem, see Classics can solve. To start from all aspects.

Believe that the new look at the above problem, should have a perceptual understanding of programming, it should not be too confused, it is only my personal point of view, may not be correct. But also a little experience, welcome reference.


If you have any different opinions, please note that

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.