Peter Norvig: Learn programming for ... 10 years

Translator’s note: This article was published by Peter Norvig in 2001. According to the 2001 version, a translation into Russian was made. In 2014, the article was updated, but the translation was not updated. Therefore, I completed my translation of the article on its current version of 2014. I believe that the article has not lost its relevance, although it is somewhat outdated. If you find any errors in the translation, write in a personal.

Where is everyone in such a hurry?


Go to any bookstore and you will immediately see a book on how to learn Java in 24 hours, as well as endless options, how to learn C, SQL, Ruby, algorithms, and so on in a few days or hours. Amazon Advanced Search [ title: teach, yourself, hours, since: 2000 ] provides a list of 512 books. Of the top ten, nine are books on programming (only one is about accounting). You will get the same results by replacing "teach yourself" with "learn" and "hours" with "days".

Hence the conclusion: either people are in a great hurry to learn programming, or to learn programming in some fabulous way more easily than anything else. Felleisen et al. they mentioned this in their book How to Design Programs , when they wrote “Bad programming is easier than simple. Idiots can learn this in 21 days, even if they are full of nerds. ” The website of the Abtruse Goose commissions also covered this topic ( here is the link ).

Let's see what the title of the book Teach Yourself C ++ in 24 Hours can mean:


Learn programming for 10 years


Research ( Bloom (1985) , Bryan & Harter (1899) , Hayes (1989) , Simmon & Chase (1973) ) showed that it takes about ten years to master skills in a particular area, for example, playing chess, musical composition, telegraphing, drawing, playing the piano, swimming, tennis, neurophysiology and topology. The secret lies in deliberate practice: not just a mechanical repetition, but a search for tasks that are higher than your current level, solving them, analyzing your actions during their solving and after they are solved, correcting mistakes made. And again. And again. There is no shorter way: even Mozart, who turned into a musical wonder child at the age of 4, took 13 years before he began to create world-class music. The Beatles in 1964 broke into the scene with a bunch of hits and performed on the Ed Sullivan show. But before that, they had played in the small clubs of Liverpool and Hamburg since 1957. And despite their worldwide fame among fans, their first success among music critics came with the release of "Sergeant Pepper" in 1967.

This idea was popularized by Malcolm Gladwell in his book, although there he talks about 10,000 hours, not 10 years. The famous photographer Henri Cartier-Bresson (1908–2004) expressed this idea in the following way: “ The first 10,000 photographs will be your worst ” (He didn’t even know that using a digital camera some people manage to achieve this figure in a week). Real experience comes with life: Samuel Johnson (1709-1784) wrote “ Experience in any field can only be obtained by the work of a lifetime; there is no lower price ”; Chaucer (1340-1400) complained: " It is so little to live, to learn so much ." Hippocrates (400 BC) is known for saying “ life is short, science is vast ”, which completely sounds like: “Ars longa, vita brevis, occasio praeceps, experimentum periculosum, iudicium difficile”, and the Russian translation short, science is vast, the case of unsteady, experience is deceptive, judgment is difficult. " Of course, no number can be an exact answer: there is no reason to assume that all skills (programming, playing chess, checkers, musical instrument) require exactly the same time to master them, as well as what different people need exactly the same time. As Professor K. Anders Ericsson said : “ In most spheres it is simply amazing how long it takes even the most talented to master mastery. The number of “10,000 hours” just helps you understand that we are talking about several years of hard work 10-20 hours a week to achieve the highest level even for the most naturally gifted from the birth of talents

So you want to become a programmer.


Here is my recipe for success in programming:


With all this, just reading books will give you not so much. Before the birth of my first child, I read all the books about caring for babies, but I still didn’t understand at all what to do. 30 months later, when my second child was getting ready to be born, do you think I looked in the books to refresh my memory? Not. I relied on my own experience, which turned out to be much more useful and better than thousands of pages written by experts.

Fred Brooks in his article " Silver Bullet Does Not Exist " outlined three steps in the search for excellent programmers:

  1. Systematically identify the best programmers as early as possible.
  2. Assign a programmer to a mentor who will develop talent and carefully monitor his career.
  3. Encourage your growing talents to communicate with each other in every way so that they can exchange ideas.

It turns out that some people already have qualities that allow them to become great programmers; you just need to send them along the right path. Alan Perlis ( Alan Perlis ) expressed it more concisely: “ Everyone can be taught to make sculptures; Michelangelo would have to learn how not to sculpt them. Likewise with great programmers . ” Perlis wanted to say that the great ones have some inner qualities that are not acquired through training. But where do these qualities come from? Is it innate? Or are they worked out by zeal? As Aguste Gusto said (the character of the cartoon Ratatouille ) " anyone can cook, but only the fearless can become great ." I believe that in our case we are talking about a burning desire to devote most of our lives to purposeful self-training in programming. But there may be a fearless more appropriate word. Or, as Anton His (critic of Agusta Gusto) said: “ not everyone can become a great artist, but a great artist can appear from everywhere ”.

So, go ahead and buy a book on Java / Ruby / JavaScript / PHP; perhaps you will get some benefit from it. But you cannot change your life and you will not become an expert in programming for 24 hours or 21 days. How about spending 24 months of hard work to continuously master the subject? Now we are already having a serious conversation ...

Literature



Answers


Estimated time to perform various operations in a typical PC:
performing typical instructions1 / 1,000,000,000 sec = 1 nanosec
reading from L1 cache0.5 nanosec
prediction error5 nanosec
read from L2 cache7 nanosec
capture / release of mutex25 nanosec
read from main memory100 nanosec
send 2K on 1Gbps network20,000 nanosec
reading 1MB sequentially from memory250,000 nanosec
read from a search disk8,000,000 nanosec
reading 1MB sequentially from disk20,000,000 nanosec
sending data packet from USA to Europe and back150 milliseconds = 150,000,000 nanosec


Application: language selection


Some readers asked me the question of which programming language they should learn first. There is no definite answer to this question, but consider the following points:


Given all these criteria, I recommend Python or Scheme as the first programming language. Or JavaScript, but not because it is ideal for beginners, but because there are a lot of textbooks on this language, for example, in the Academy of Caen . But your particular case may be special, so there are many other languages ​​to choose from. If you are under ten years old, you might like Alice or Squeak or Blockly (older students might also like them). The main thing is to make a choice and start learning.

Appendix: Books and other resources


They ask me which books and websites are best for learning. I repeat once again: “reading books alone is not enough,” but I would recommend the following:

Source: https://habr.com/ru/post/416167/


All Articles