Ten years of Learning programming Author: Peter Norvig translation: Dai Yuwen

Source: Internet
Author: User

Why is everyone so anxious?

Walk into any bookstore and you'll see a book called "How To learn Java in 7 days," and a variety of similar books: Learn Visual Basic, Windows, the Internet, and so on in a few days or hours, with no end in sight. I did the following powerful search on Amazon:

     Pubdate:after 1992 and Title:days and      (Title:learn or Title:teach yourself)

248 results were obtained. The first 78 are computer-like books (the 79th one is learn Bengaliin). I replaced "Days" with "hours" and got a similar result: more than 253 books. The first 77 books are computers, the 78th is Teach yourself Grammar and Style in Hours. Of the first 200 books, 96% are computer-like books.

The conclusion is: either people are in a hurry to learn computers, or computers are easier to learn than anything else. No books teach you to learn classical music, quantum physics, or dog-keeping in a few days.

Let us analyze what it means to be like a book entitled "Learning Pascal within three days ":

    • Learning: in three days, you have no time to write important programs and benefit from success or failure. You don't have time to work with experienced programmers and understand how working in that environment is going on. In a word, you will not have time to learn too many things. So they can only talk about superficial things, not deep understanding. As the Pope of Arnie said, it is dangerous to have a scratch.

    • Pascal: in three days, you may learn the grammar of Pascal (if you've learned a similar language), but you can't learn more about how to use these grammars. In other words, if you were a basic programmer, you could learn to write basic-style programs in Pascal's grammar, but you wouldn't understand the real benefits (and drawbacks) of Pascal. So what's the point? Alan Perlis said: "A language that does not change the way you think about programming is not worth learning." "One possible scenario is that you have to learn a little Pascal (or more likely, like visual Basic or JavaScript), because you need to interface with an existing tool in order to accomplish a particular task. But that is not learning how to program, but learning how to accomplish that task.

    • within three days: Unfortunately, this is not enough, because the next section tells us.
Learn to program in 10 years

Studies have shown that (Hayes,bloom) in any field, such as chess, composition, painting, piano playing, swimming, tennis, and atomic physics and topology, and so on, to reach the level of experts will be about 10 years of time. There is no real shortcut: Even Mozart, a musical prodigy at the age of 4, began writing world-class work 13 years later. On the other hand, The Beatles appeared to be a hit on the 1964 Ed Sullivan Performance. But they have been performing since 1957, and after gaining popularity, their first major success,Sgt Peppers, was released in 1967. Samuel Johnson (Samuel Johnson, British lexicography and writer) thinks it takes more than 10 years: "To excel in any field is to be achieved with a lifetime of toil; it cannot be obtained at a lower cost." and Chaucer (Chaucer, the English poet) lamented: "Life is short, and it is boundless." ”

This is my recipe for successful programming:

  • Try to be interested in programming, and make some programs because it is interesting. Make sure that programming is fun enough so you're willing to devote ten years of your valuable time.

  • Communicate with other programmers, read other programs. This is more important than any book or training course.

  • Write the program. The best way to learn is to learn from practice. In more technical terms, "in a given field, the greatest ability of an individual is not automatically gained by expanded experience, but even highly experienced people can improve their abilities through conscious efforts" (p. 366) and "the most effective learning needs to vary with the appropriate difficulty, goal-specific tasks, Rich feedback, as well as repeated opportunities and bug fixes. "(see page 20-21) This book cognition in Practice:mind,mathematics,and Culture in everyday life is an interesting reference to illustrate this view.

  • If you want, stay in college for 4 years or longer (in graduate school). You will be exposed to a number of jobs that require academic credentials, and you will have a deeper understanding of this area. If you don't like school, you can (through some contributions) get similar experiences at work. In any case, light moreing is not enough. Eric Raymond, the author of theNew Hacker's Dictionary , said, "Computer science can't turn anyone into a programmer, just like light research brushes and pigments don't make people into painters." "One of the best programmers I've ever hired was a high school degree; he made a lot of good software, he had his own newsgroups, and with stock options, he was definitely richer than me."

  • Work with other programmers on the project. Some of these projects are the best programmers, while others are the worst. When you are the best, you can test the ability to lead a project and inspire others with your point of view. When you are the worst, you learn how great people do and understand what they don't like to do (because they tell you to do things).

  • Take over the project after other programmers. Make yourself understood by someone else to write the program. When the original author of the program is absent, study what needs to be understood and modified. Think about how to design your program for later maintenance.

  • Learn at least half a dozen programming languages. Includes a language that supports abstract classes (like Java or C + +), a language that supports functional abstraction (like Lisp or ML), a language that supports syntax abstraction (like Lisp), a language that supports declarative specifications (like Prolog or C + + templates), a support A common-line program (coroutine) language (like icon or scheme), a language that supports parallelism (like sisal).

  • Remember the word "Computer" in computer science. Learn how long it takes your computer to execute an instruction, take a word from memory (with the cache), read successive words from the disk, and find a new location on the disk. Answer

  • To participate in a language standardization work. It can be an ANSI C + + committee, or it can be decided that your programming style around a small area should be two or four spaces indented. In either way, you learn about other people's ideas in a language, their depth of understanding, and even some of the reasons why they think so.

  • Find the right reasons to get away from the language standardization effort as quickly as possible.

Knowing that, just how much you can get from a book becomes a problem. Before my first child was born, I read all the How-to books and still felt like a novice. 30 months later, my second child is about to be born, do I go back to reviewing these books? No. Instead, I rely on my personal experience, which is more useful and reliable than the thousands of-page book written by experts.

Fred Brooks A three-step plan for a good software designer in his essay, "no silver Bullet" :

    1. Identify top-level designers in a systematic manner as early as possible.

    2. Assign a professional mentor to the designer who will be responsible for their technical growth and carefully plan their career.

    3. Provide opportunities for developing designers to communicate and learn from each other.

The plan assumes that some people already have the necessary talent for outstanding designers, and that all they have to do is to induce them appropriately. Alan Perlis is more concise: "Everyone can be carved by the church: for Michelangelo, instead tell him what to do." The same is true for good programmers. ”

So go ahead and buy that Java book. You may learn something from it. But as a programmer, you will not change your life or your actual level within a few days or within 24 hours, even within a few months.

Reference documents

Bloom, Benjamin (ed.) Developing Talentin young People, Ballantine, 1985.

Brooks, Fred, no Silver bullets, IEEE Computer, vol. 4, 1987, p. 10-19.

Hayes, John R., complete problem Solver Lawrence Erlbaum, 1989.

Lave, Jean, cognition in Practice:mind, mathematics, and Culture in everydaylife, Cambridge University Press, 1 988.

Answer

2001 Summer Typical 1GHz PC's various operations take time

Execute an instruction 1 nsec = (1/1,000,000,000) sec
Take a word from the L1 cache memory 2 nsec
Take a word out of memory Ten Nsec
Take a word from a contiguous location on a disk Nsec
Take a word from the new location of the disk (seek) 8,000,000nsec = 8msec
Appendix: Choice of language

Many people ask me what kind of programming language they should learn first. There is no absolute answer, but please consider the following points:

    • with your friend's . When asked, "What operating system should I use, Windows,unix, or Mac?" "I always answer:" What your friends use, you use. "You can learn knowledge from your friends, and this advantage can offset the essential differences between different operating systems or languages. Also consider your future friends: The programmer community-you will be part of it if you continue to move forward. Does the language you choose have a growing community, or do you have a few people and are dying? Are there books, websites, online forums to answer your questions? Do you like those people in the forum?

    • Keep it simple, stupid. Languages like C + + and Java are designed for the professional development of teams of experienced programmers who focus on the efficiency of code runtime. Therefore, some parts of these languages are very complex. And your focus is on how to program and don't need that complexity. What you need is a language: it's easy to remember for a single novice programmer.

    • practice . What kind of way do you prefer to learn to play the piano: The usual interactive way, you can hear the notes as soon as you press the keys, or "batch" mode, you can only play the whole tune to hear the notes? Obviously, learning to play the piano in interactive mode is easier and programming is the same. Adhere to the interactive mode of learning and use a language.

With the above guidelines, the first programming language I recommend is Python or scheme. There are other good choices for each person. If you are under the age of 10, you may prefer Alice. The point is that you have to choose and start practicing.

Appendix: Books and other resources

Many people ask me what books or Web pages they should start to learn from. I reiterate that it is not enough to learn from books alone. "But I recommend it:

    • Scheme: Structure and interpretation of Computer Programs (Abelson & Sussman) may be the best introductory book in computer science, and it does teach programming as a way to understand computer science. But it is challenging and can deter many who may succeed in other ways.

    • Scheme: How to Design Programs (Felleisen et al.) is one of the best books on how to design a program in a graceful, functional way.

    • Python: Python Programming:an Intro to CS (Zelle) is an excellent guide to getting started with Python.

    • Python: There are many online guides on python.org.

    • Oz: Concepts, techniques, and Models of computer programming (Van Roy & Haridi) are regarded as contemporary inheritors of Abelson & Sussman. It is a patrol of high-level concepts of programming. The scope is broader than Abelson & Sussman, and may be easier to learn and follow up. It uses a language called Oz, which is not well known, but can be used as a basis for learning other languages.

Footnote

This page also available in Japanese translation thanks to Yasushi Murakawa, in Spanish translation thanks to Carlos Rueda and Ingerman translation thanks to Stefan Ram.

T. capey points out that the complete problem Solver page on Amazon now have the "Teach yourself Bengali in + days" and "t Each yourself Grammar and Style "books under the" Customers who shopped for this item also shopped for these items "Sectio N. I guess that a large portion of the people, who look at the-book is coming from this page.

Peter Norvig (Copyright 2001)

Ten years of Learning programming Author: Peter Norvig translation: Dai Yuwen

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.