Teach Yourself Programming in Ten YearsPeter NorvigWhy is everyone in such a rush?Walk into any bookstore, and you'll see how to Teach Yourself Javain 7 Days alongside endless variations offering to teach VisualBasic, Windows, the Internet, and so on in a few days or hours. I didthe following power search at Amazon.com: pubdate: after 1992 and title: days and (title: learn or title: teach yourself)and got back 248 hits. The first 78 were computer books (number 79was LearnBengali in 30 days). I replaced "days" with "hours"and got remarkably similar results: 253 more books, with 77 computerbooks followed by TeachYourself Grammar and Style in 24 Hours at number 78. Out ofthe top 200 total, 96% were computer books. The conclusion is that either people are in a big rush to learnabout computers, or that computers are somehow fabulously easier tolearn than anything else. There are no books on how to learnBeethoven, or Quantum Physics, or even Dog Grooming in a few days.Felleisen et al.give a nod to this trend in their book How to Design Programs, when they say"Bad programming is easy. Idiots can learn it in 21 days,even if they are dummies. Let's analyze what a title like Learn C++ in Three Dayscould mean:
Everyone, from all three groups, started playing at roughly the sametime - around the age of five. In those first few years, everyonepractised roughly the same amount - about two or three hours aweek. But around the age of eight real differences started toemerge. The students who would end up as the best in their class beganto practise more than everyone else: six hours a week by age nine,eight by age 12, 16 a week by age 14, and up and up, until by the ageof 20 they were practising well over 30 hours a week. By the age of20, the elite performers had all totalled 10,000 hours of practiceover the course of their lives. The merely good students had totalled,by contrast, 8,000 hours, and the future music teachers just over4,000 hours.So it may be that 10,000 hours, not 10 years, is the magic number.Samuel Johnson (1709-1784) thought ittook longer: "Excellence in any department can beattained only by the labor of a lifetime; it is not to be purchased ata lesser price." And Chaucer (1340-1400) complained "the lyf so short, the craftso long to lerne." Hippocrates (c. 400BC) is known for the excerpt "ars longa,vita brevis", which is part of the longer quotation "Ars longa, vitabrevis, occasio praeceps, experimentum periculosum, iudiciumdifficile", which in English renders as "Life is short, [the] craftlong, opportunity fleeting, experiment treacherous, judgmentdifficult." Although in Latin, ars can mean either art orcraft, in the original Greek the word "techne" can only mean "skill", not "art". |
本帖最后由 linux_Ultra 于 2009-9-17 19:55 編輯 Here's my recipe for programming success:
ReferencesBloom, Benjamin (ed.) Developing Talent in Young People, Ballantine, 1985. Brooks, Fred, No Silver Bullets, IEEE Computer, vol. 20, no. 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, 1988. AnswersApproximate timing for various operations on a typical 1GHz PC in 2001:
|
Appendix: Language Choice Several people have asked what programming language they should learn first. There is no one answer, but consider these points: * Use your friends. When asked "what operating system should I use, Windows, Unix, or Mac?", my answer is usually: "use whatever your friends use." The advantage you get from learning from your friends will offset any intrinsic difference between OS, or between programming languages. Also consider your future friends: the community of programmers that you will be a part of if you continue. Does your chosen language have a large growing community or a small dying one? Are there books, web sites, and online forums to get answers from? Do you like the people in those forums? * Keep it simple. Programming languages such as C++ and Java are designed for professional development by large teams of experienced programmers who are concerned about the run-time efficiency of their code. As a result, these languages have complicated parts designed for these circumstances. You're concerned with learning to program. You don't need that complication. You want a language that was designed to be easy to learn and remember by a single new programmer. * Play. Which way would you rather learn to play the piano: the normal, interactive way, in which you hear each note as soon as you hit a key, or "batch" mode, in which you only hear the notes after you finish a whole song? Clearly, interactive mode makes learning easier for the piano, and also for programming. Insist on a language with an interactive mode and use it. Given these criteria, my recommendations for a first programming language would be Python or Scheme. But your circumstances may vary, and there are other good choices. If your age is a single-digit, you might prefer Alice or Squeak (older learners might also enjoy these). The important thing is that you choose and get started. Appendix: Books and Other Resources Several people have asked what books and web pages they should learn from. I repeat that "book learning alone won't be enough" but I can recommend the following: * Scheme: Structure and Interpretation of Computer Programs (Abelson & Sussman) is probably the best introduction to computer science, and it does teach programming as a way of understanding the computer science. You can see online videos of lectures on this book, as well as the complete text online. The book is challenging and will weed out some people who perhaps could be successful with another approach. * Scheme: How to Design Programs (Felleisen et al.) is one of the best books on how to actually design programs in an elegant and functional way. * Python: Python Programming: An Intro to CS (Zelle) is a good introduction using Python. * Python: Several online tutorials are available at Python.org. * Oz: Concepts, Techniques, and Models of Computer Programming (Van Roy & Haridi) is seen by some as the modern-day successor to Abelson & Sussman. It is a tour through the big ideas of programming, covering a wider range than Abelson & Sussman while being perhaps easier to read and follow. It uses a language, Oz, that is not widely known but serves as a basis for learning other languages. < Notes T. Capey points out that the Complete Problem Solver page on Amazon now has the "Teach Yourself Bengali in 21 days" and "Teach Yourself Grammar and Style" books under the "Customers who shopped for this item also shopped for these items" section. I guess that a large portion of the people who look at that book are coming from this page. Thanks to Ross Cohen for help with Hippocrates. |
“計算機語(yǔ)言(C++、JAVA等),學(xué)起來(lái)簡(jiǎn)單,教起來(lái)也簡(jiǎn)章”。是不是這樣?今天瀏覽互聯(lián)網(wǎng),無(wú)意看到下面的文章,大家看后可以點(diǎn)評。以下是譯文與原文。 用十年學(xué)習編程 為什么每個(gè)人都急不可耐? 走進(jìn)任何一家書(shū)店,你會(huì )看見(jiàn)《Teach Yourself Java in 7 Days》(7天Java無(wú)師自通)的旁邊是一長(cháng)排看不到盡頭的類(lèi)似書(shū)籍,它們要教會(huì )你Visual Basic、Windows、Internet等等,而只需要幾天甚至幾小時(shí)。我在A(yíng)mazon.com上進(jìn)行了如下搜索: pubdate: after 1992 and title: days and (title: learn or title: teach yourself) (出版日期:1992年后 and 書(shū)名:天 and (書(shū)名:學(xué)會(huì ) or 書(shū)名:無(wú)師自通)) 我一共得到了248個(gè)搜索結果。前面的78個(gè)是計算機書(shū)籍(第79個(gè)是《Learn Bengali in 30 days》,30天學(xué)會(huì )孟加拉語(yǔ))。我把關(guān)鍵詞“days”換成“hours”,得到了非常相似的結果:這次有253本書(shū),頭77本是計算機書(shū)籍,第78 本是《Teach Yourself Grammar and Style in 24 Hours》(24小時(shí)學(xué)會(huì )文法和文體)。頭200本書(shū)中,有96%是計算機書(shū)籍。 結論是,要么是人們非常急于學(xué)會(huì )計算機,要么就是不知道為什么計算機驚人地簡(jiǎn)單,比任何東西都容易學(xué)會(huì )。沒(méi)有一本書(shū)是要在幾天里教會(huì )人們欣賞貝多芬或者量子物理學(xué),甚至怎樣給狗打扮。 讓我們來(lái)分析一下像《Learn Pascal in Three Days》(3天學(xué)會(huì )Pascal)這樣的題目到底是什么意思: 學(xué)會(huì ):在3天時(shí)間里,你不夠時(shí)間寫(xiě)一些有意義的程序,并從它們的失敗與成功中學(xué)習。你不夠時(shí)間跟一些有經(jīng)驗的程序員一起工作,你不會(huì )知道在那樣的環(huán)境中是什么滋味。簡(jiǎn)而言之,沒(méi)有足夠的時(shí)間讓你學(xué)到很多東西。所以這些書(shū)談?wù)摰闹皇潜砻嫔系木,而非深入的理解。如Alexander Pope(英國詩(shī)人、作家,1688-1744)所言,一知半解是危險的(a little learning is a dangerous thing) Pascal:在3天時(shí)間里你可以學(xué)會(huì )Pascal的語(yǔ)法(如果你已經(jīng)會(huì )一門(mén)類(lèi)似的語(yǔ)言),但你無(wú)法學(xué)到多少如何運用這些語(yǔ)法。簡(jiǎn)而言之,如果你是,比如說(shuō)一個(gè) Basic程序員,你可以學(xué)會(huì )用Pascal語(yǔ)法寫(xiě)出Basic風(fēng)格的程序,但你學(xué)不到Pascal真正的優(yōu)點(diǎn)(和缺點(diǎn))。那關(guān)鍵在哪里?Alan Perlis(ACM第一任主席,圖靈獎得主,1922-1990)曾經(jīng)說(shuō)過(guò):“如果一門(mén)語(yǔ)言不能影響你對編程的想法,那它就不值得去學(xué)”。另一種觀(guān)點(diǎn)是,有時(shí)候你不得不學(xué)一點(diǎn)Pascal(更可能是Visual Basic和javascript之類(lèi))的皮毛,因為你需要接觸現有的工具,用來(lái)完成特定的任務(wù)。但此時(shí)你不是在學(xué)習如何編程,你是在學(xué)習如何完成任務(wù)。 3天:不幸的是,這是不夠的,正如下一節所言。 10年編程無(wú)師自通 一些研究者(Hayes、Bloom)的研究表明,在許多領(lǐng)域,都需要大約10 年時(shí)間才能培養出專(zhuān)業(yè)技能,包括國際象棋、作曲、繪畫(huà)、鋼琴、游泳、網(wǎng)球,以及神經(jīng)心理學(xué)和拓撲學(xué)的研究。似乎并不存在真正的捷徑:即使是莫扎特,他4 歲就顯露出音樂(lè )天才,在他寫(xiě)出世界級的音樂(lè )之前仍然用了超過(guò)13年時(shí)間。再看另一種音樂(lè )類(lèi)型的披頭士,他們似乎是在1964年的Ed Sullivan節目中突然冒頭的。但其實(shí)他們從1957年就開(kāi)始表演了,即使他們很早就顯示出了巨大的吸引力,他們第一次真正的成功——Sgt. Peppers——也要到1967年才發(fā)行。Samuel Johnson(英國詩(shī)人)認為10 年還是不夠的:“任何領(lǐng)域的卓越成就都只能通過(guò)一生的努力來(lái)獲得;稍低一點(diǎn)的代價(jià)也換不來(lái)! (Excellence in any department can be attained only by the labor of a lifetime; it is not to be purchased at a lesser price.)喬叟(Chaucer,英國詩(shī)人,1340-1400)也抱怨說(shuō):“生命如此短暫,掌握技藝卻要如此長(cháng)久!保╰he lyf so short, the craft so long to lerne.) 下面是我在編程這個(gè)行當里獲得成功的處方: 對編程感興趣,因為樂(lè )趣而去編程。確定始終都能保持足夠的樂(lè )趣,以致你能夠將10年時(shí)間投入其中。 跟其他程序員交談;閱讀其他程序。這比任何書(shū)籍或訓練課程都更重要。 編程。最好的學(xué)習是從實(shí)踐中學(xué)習。用更加技術(shù)性的語(yǔ)言來(lái)講,“個(gè)體在特定領(lǐng)域最高水平的表現不是作為長(cháng)期的經(jīng)驗的結果而自動(dòng)獲得的,但即使是非常富有經(jīng)驗的個(gè)體也可以通過(guò)刻意的努力而提高其表現水平!保╬. 366),而且“最有效的學(xué)習要求為特定個(gè)體制定適當難度的任務(wù),有意義的反饋,以及重復及改正錯誤的機會(huì )!保╬. 20-21)《Cognition in Practice: Mind, Mathematics, and Culture in Everyday Life》(在實(shí)踐中認知:心智、數學(xué)和日常生活的文化)是關(guān)于這個(gè)觀(guān)點(diǎn)的一本有趣的參考書(shū)。 如果你愿意,在大學(xué)里花上4年時(shí)間(或者再花幾年讀研究生)。這能讓你獲得一些工作的入門(mén)資格,還能讓你對此領(lǐng)域有更深入的理解,但如果你不喜歡進(jìn)學(xué)校,(作出一點(diǎn)犧牲)你在工作中也同樣能獲得類(lèi)似的經(jīng)驗。在任何情況下,單從書(shū)本上學(xué)習都是不夠的!坝嬎銠C科學(xué)的教育不會(huì )讓任何人成為內行的程序員,正如研究畫(huà)筆和顏料不會(huì )讓任何人成為內行的畫(huà)家”, Eric Raymond,《The New Hacker's Dictionary》(新黑客字典)的作者如是說(shuō)。我曾經(jīng)雇用過(guò)的最優(yōu)秀的程序員之一僅有高中學(xué)歷;但他創(chuàng )造出了許多偉大的軟件,甚至有討論他本人的新聞組,而且股票期權讓他達到我無(wú)法企及的富有程度(譯注:指Jamie Zawinski,Xemacs和Netscape的作者)。 跟別的程序員一起完成項目。在一些項目中成為最好的程序員;在其他一些項目中當最差的一個(gè)。當你是最好的程序員時(shí),你要測試自己領(lǐng)導項目的能力,并通過(guò)你的洞見(jiàn)鼓舞其他人。當你是最差的時(shí)候,你學(xué)習高手們在做些什么,以及他們不喜歡做什么(因為他們讓你幫他們做那些事)。 接手別的程序員完成項目。用心理解別人編寫(xiě)的程序?纯丛跊](méi)有最初的程序員在場(chǎng)的時(shí)候理解和修改程序需要些什么。想一想怎樣設計你的程序才能讓別人接手維護你的程序時(shí)更容易一些。 學(xué)會(huì )至少半打編程語(yǔ)言。包括一門(mén)支持類(lèi)抽象(class abstraction)的語(yǔ)言(如Java或C++),一門(mén)支持函數抽象(functional abstraction)的語(yǔ)言(如Lisp或ML),一門(mén)支持句法抽象(syntactic abstraction)的語(yǔ)言(如Lisp),一門(mén)支持說(shuō)明性規約(declarative specification)的語(yǔ)言(如Prolog或C++模版),一門(mén)支持協(xié)程(coroutine)的語(yǔ)言(如Icon或Scheme),以及一門(mén)支持并行處理(parallelism)的語(yǔ)言(如Sisal)。 記住在“計算機科學(xué)”這個(gè)詞組里包含“計算機”這個(gè)詞。了解你的計算機執行一條指令要多長(cháng)時(shí)間,從內存中取一個(gè)word要多長(cháng)時(shí)間(包括緩存命中和未命中的情況),從磁盤(pán)上讀取連續的數據要多長(cháng)時(shí)間,定位到磁盤(pán)上的新位置又要多長(cháng)時(shí)間。(答案在這里。) 嘗試參與到一項語(yǔ)言標準化工作中?梢允茿NSI C++委員會(huì ),也可以是決定自己團隊的編碼風(fēng)格到底采用2個(gè)空格的縮進(jìn)還是4個(gè)。不論是哪一種,你都可以學(xué)到在這門(mén)語(yǔ)言中到底人們喜歡些什么,他們有多喜歡,甚至有可能稍微了解為什么他們會(huì )有這樣的感覺(jué)。 擁有盡快從語(yǔ)言標準化工作中抽身的良好判斷力。 |
抱著(zhù)這些想法,我很懷疑從書(shū)上到底能學(xué)到多少東西。在我第一個(gè)孩子出生前,我讀完了所有“怎樣……”的書(shū),卻仍然感到自己是個(gè)茫無(wú)頭緒的新手。30個(gè)月后,我第二個(gè)孩子出生的時(shí)候,我重新拿起那些書(shū)來(lái)復習了嗎?不。相反,我依靠我自己的經(jīng)驗,結果比專(zhuān)家寫(xiě)的幾千頁(yè)東西更有用更靠得住。 Fred Brooks在他的短文《No Silver Bullets》(沒(méi)有銀彈)中確立了如何發(fā)現杰出的軟件設計者的三步規劃: 盡早系統地識別出最好的設計者群體。 指派一個(gè)事業(yè)上的導師負責有潛質(zhì)的對象的發(fā)展,小心地幫他保持職業(yè)生涯的履歷。 讓成長(cháng)中的設計師們有機會(huì )互相影響,互相激勵。 這實(shí)際上是假定了有些人本身就具有成為杰出設計師的必要潛質(zhì);要做的只是引導他們前進(jìn)。Alan Perlis說(shuō)得更簡(jiǎn)潔:“每個(gè)人都可以被教授如何雕塑;而對米開(kāi)朗基羅來(lái)說(shuō),能教給他的倒是怎樣能夠不去雕塑。杰出的程序員也一樣”。 所以盡管去買(mǎi)那些Java書(shū);你很可能會(huì )從中找到些用處。但你的生活,或者你作為程序員的真正的專(zhuān)業(yè)技術(shù),并不會(huì )因此在24小時(shí)、24天甚至24個(gè)月內發(fā)生真正的變化。 |
本帖最后由 linux_Ultra 于 2009-9-17 20:04 編輯 ...................... Outliers ...................... |
是不是應該發(fā)到“英語(yǔ)交流”版塊呢? |