Why are everyone in such a rush? Walk into any bookstore, and you'll see how toTeach yourself Java in HoursAlongside endless variations offering to teach C, SQL, Ruby, algorithms, and so on with a few days or hours. The Amazon advanced search for [Title:teach, yourself, hours, since:2000 and found such books. Of the top ten, Nine was programming books (the other was about bookkeeping). Similar results come from replacing ' teach yourself ' with ' learn ' or ' hours ' with ' days '. The conclusion is that either people be in a big rush to learn on programming, or that programming is somehow fabulous Ly easier to learn than anything else. Felleisen et al give a nod to this trend in their book What to Design Programswhen they say ' bad progr Amming is easy. Idiots can learn it in days, even if they is dummies. " The Abtruse Goose comic also had their take. Let's analyze what's a title like Teach yourself C + + in Hours could mean:
- Teach yourself: in hours you won ' t has time to write several significant programs, and learn from Your successes and failures with them. you won ' t has time to work with an experienced programmer and understand WH At it's like to live in a C + + environment. in short, you won ' t has time to learn much. so the book can only Be talking on a superficial familiarity, not a deep understanding. As Alexander Pope said, a little learning is a dangerous thing.
- C + +: In hours might is able to learn some of the syntax of C + + (if you already know another language), but you couldn ' t Learn much the language. In short, if you were, say, a Basic programmer, you could learn to write programs in the style of the Basic using C + + syntax, But the couldn ' t learn what C + + is actually good (and bad) for. So what's the point? Alan Perlis once said: "A language that doesn ' t affect the the-I think about programming, was not worth knowing". One possible point is so you had to learn a tiny bit of C + + (or more likely, something like JavaScript or processing) b Ecause a accomplish task for need to interface with an existing tool to specific. But then your ' re not learning what to program; You ' re learning to accomplish the that task.
- In Hours: Unfortunately, this was not enough, and as the next section shows.
Teach yourself programming in Ten yearsResearchers (Bloom (1985), Bryan & Harter (1899), Hayes (1989), Simmon & Chase (1973)) has shown it takes about t En years to develop expertise in any of a wide variety of areas, including chess playing, music composition, Telegraph Ope Ration, painting, piano playing, swimming, tennis, and in neuropsychology and topology. The key isDeliberativePractice:not just doing it again and again, but challenging yourself with a task that's just beyond your current ability , trying it, analyzing your performance while and after doing it, and correcting any mistakes. Then repeat. and repeat again. There appear to is no real shortcuts:even Mozart, who is a musical prodigy at age 4, took + years before he began To produce world-class music. In another genre, the Beatles seemed to burst onto the scene with a string of #1 hits and an appearance on the Ed Sullivan Show in 1964. But they had been playing small clubs in Liverpool and Hamburg since 1957, and while they had mass appeal early on, their First great critical success,Sgt. Peppers, was released in 1967. Malcolm Gladwell have popularized the idea, although he concentrates on the hours rather than. It is the-hours, not-years, is the magic number. Or It might is some other metric; Henri Cartier-Bresson (1908-2004) said "Your first photographs is Your worst." True Expertise Lifetime:samuel Johnson (1709-1784) said "excellence in any department can attained The labor of a lifetime; It is not to being purchased at a lesser price. " and Chaucer (1340-1400) complained "The Lyf so short, the craft so long to Lerne." Hippocrates (c. 400BC) is known for the excerpt "Ars Longa, Vita brevis", which are part of the longer quotation "Ars longa , Vita brevis, Occasio praeceps, experimentum periculosum, Iudicium difficile ", which in 中文版 renders as" life was short , [the] craft long, opportunity fleeting, experiment treacherous, judgment difficult. " Of course, no single number can is the final answer:it doesn ' t seem reasonable to assume so each of programming, chess Playing, checkers playing, and music playing could all require exactly the same amount of time to master, nor so all PEO Ple'll take exactly the same amount of time. So you want to be a ProgrammerHere's my recipe for programming success:
- Get interested in programming, and does some because it is fun. Make sure this it keeps being enough fun so then you'll be willing to put in your ten years/10,000 hours.
- Program. The best kind of learning are learning by doing. To put it more technically, "the maximal level of performance for individuals in a given domain was not attained automatica Lly as a function of extended experience, but the level of performance can is increased even by highly experienced Individ Uals as a result of deliberate efforts to improve. " (p. 366) and "the most effective learning requires a well-defined task with an appropriate difficulty level for the partic Ular individual, informative feedback, and opportunities for repetition and corrections of errors. " (p. 20-21) The book Cognition in Practice:mind, mathematics, and Culture in everyday life are an interesting re Ference for this viewpoint.
- talk with other programmers; Read other programs. This is more important than any book or training course.
- If you want, put in four years at a college (or more at a graduate school) . this would give you Access to some jobs that require credentials, and it'll give you a deeper understanding of the field, but if you don ' t E NJoy School, you can (with some dedication) get similar experience on your own or on the job. In any case, book learning alone won ' is enough. "Computer science education cannot make anybody a expert programmer any further than studying brushes and pigment can make s Omebody an expert painter "says Eric Raymond, author of the New Hacker ' s Dictionary . One of the best programmers I ever hired had only a high School degree; He's produced a lot of great software, had his own news group, and made enough in the stock options to buy his own nightclub.< p>
- Work on projects with other programmers. Being the best programmer on some projects; Be the worst on some others. When your ' re the best, you get to test your abilities to leads a project, and to inspire others with your vision. When you're the worst, you learn what the Masters does, and you learn what they don ' t like to do (because they make you do I T for them).
- Work on projects after other programmers. Understand a program written by someone else. See what it takes to understand and fix it when the original programmers is not around. Think about-to-design your programs to make it easier-those who'll maintain them after you.
- Learn at least a half dozen programming languages. Include one language that emphasizes class abstractions (like Java or C + +), one that emphasizes functional abstraction (Li Ke lisp or ML or Haskell), one, supports syntactic abstraction (like Lisp), one, supports declarative specificatio NS (like Prolog or C + + templates), and one that is emphasizes parallelism (like Clojure or Go).
- Remember that there was a "computer" in "Computer Science". Know How long it takes your computer to execute an instruction, fetch a word from memory (with and without a cache miss), Read consecutive words from disk, and seek to a new location on disk. (Answers here.)
- Get involved in a language standardization effort. It could be the ANSI C + + committee, or it could be deciding if your local coding style would have 2 or 4 space indentation Levels. Either-Learn, what's the people like in a language, how deeply they feel so, and perhaps even a little about Why they feel.
- The good sense to get off The language standardization effort as quickly as possible.
With all, it questionable how far can get just by book learning. Before my first child is born, I read all the what to books, and still felt like a clueless novice. Months later, when my second is due, did I go and the books for a refresher? No. Instead, I relied on my personal experience, which turned off to being far more useful and reassuring to me than the Thousan DS of pages written by experts. Fred Brooks, in He essay No Silver Bullet identified a Three-part plan for finding great software designers:
- Systematically identify top designers as early as possible.
- Assign a career mentor to being responsible for the development of the prospect and carefully keep a career file.
- Provide opportunities for growing designers to interact and stimulate.
This assumes, some people already has the qualities necessary for being a great designer; the job was to properly c Oax them along. Alan Perlis put it more succinctly: "Everyone can is taught to Sculpt:michelangelo would has had t o being taught how does not. So it's with the great programmers ". Perlis are saying that the greats has some internal quality that transcends th Eir training. But where does the quality come from? are it innate? Or do they develop it through DILIGENC e? as Auguste Gusteau (the fictional chef in Ratatouille ) puts it, "Anyone can cook, and only the fearless can be great. " I think of it more as willingness to devote a large portion of one's life to deliberative practice. but maybe Fearless is a-to-summarize that. Or, as Gusteau ' s critic, Anton Ego, says: "Not everyone can become a great artist, but a great artist can come from anywhe Re. " So go ahead and buy this java/ruby/javascript/php book; You'll probably get some use out of it. But you won ' t-your life, or your real overall expertise as a programmer in + hours or days. How is working hard-to-continually improve over months? Well, now your ' re starting to get somewhere ... ReferencesBloom, Benjamin (ed.) Developing Talentin young People, Ballantine, 1985. Brooks, Fred, no Silver bullets, IEEE Computer, vol. 4, 1987, p. 10-19. Bryan, W.L & Harter, N. "Studies on the telegraphic Language:the acquisition of a hierarchy of habits. Psychology Review, 1899, 8, 345-375 Hayes, John R., complete problem Solver Lawrence Erlbaum, 1989. Chase, William G. & Simon, Herbert A. "Perception in Chess" cognitive Psychology, 1973, 4, 55-81. Lave, Jean, cognition in Practice:mind, mathematics, and Culture in everydaylife, Cambridge University Press, 1 988. AnswersApproximate timing for various operations on a typical PC:
Execute typical instruction |
1/1,000,000,000 sec = 1 nanosec |
Fetch from L1 cache memory |
0.5 nanosec |
Branch Misprediction |
5 nanosec |
Fetch from L2 cache memory |
7 nanosec |
Mutex Lock/unlock |
Nanosec |
Fetch from main memory |
Nanosec |
Send 2K bytes over 1Gbps network |
20,000 nanosec |
Read 1MB sequentially from memory |
250,000 nanosec |
Fetch from the new disk location (seek) |
8,000,000 nanosec |
Read 1MB sequentially from disk |
20,000,000 nanosec |
Send packet US to Europe and back |
milliseconds = 150,000,000 Nanosec |
|