Teach Yourself Programming in Ten Years
Peter Norvig
Why is everyone in such a rush?
Walk into any bookstore, and you'll see how to?Teach Yourself Java in 24 Hours?alongside endless variations offering to teach C, SQL, Ruby, Algorithms, and so on in a few days or hours. The Amazon advanced search for [title: teach, yourself, hours, since: 2000?and found 512 such books. Of the top ten, nine are programming books (the other is about bookkeeping). Similar results come from replacing "teach yourself" with "learn" or "hours" with "days."
The conclusion is that either people are in a big rush to learn about programming, or that programming is somehow fabulously easier to learn than anything else. 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." The Abtruse Goose comic also had?their take.
Let's analyze what a title like?Teach Yourself C++ in 24 Hours?could mean:
Teach Yourself:?In 24 hours you won't have time to write several significant programs, and learn from your successes and failures with them. You won't have time to work with an experienced programmer and understand what it is like to live in a C++ environment. In short, you won't have time to learn much. So the book can only be talking about a superficial familiarity, not a deep understanding. As Alexander Pope said, a little learning is a dangerous thing.
C++:?In 24 hours you might be able to learn some of the syntax of C++ (if you already know another language), but you couldn't learn much about how to use the language. In short, if you were, say, a Basic programmer, you could learn to write programs in the style of Basic using C++ syntax, but you 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 way you think about programming, is not worth knowing". One possible point is that you have to learn a tiny bit of C++ (or more likely, something like JavaScript or Processing) because you need to interface with an existing tool to accomplish a specific task. But then you're not learning how to program; you're learning to accomplish that task.
in 24 Hours:?Unfortunately, this is not enough, as the next section shows.
Teach Yourself Programming in Ten Years
Researchers (Bloom (1985),?Bryan & Harter (1899),?Hayes (1989),?Simmon & Chase (1973)) have shown it takes about ten years to develop expertise in any of a wide variety of areas, including chess playing, music composition, telegraph operation, painting, piano playing, swimming, tennis, and research in neuropsychology and topology. The key is?deliberative?practice: not just doing it again and again, but challenging yourself with a task that is 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 be no real shortcuts: even Mozart, who was a musical prodigy at age 4, took 13 more 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?has popularized the idea, although he concentrates on 10,000 hours, not 10 years. Henri Cartier-Bresson (1908-2004) had another metric: "Your first 10,000 photographs are your worst." (He didn't anticipate that with digital cameras, some people can reach that mark in a week.) True expertise may take a lifetime: Samuel Johnson (1709-1784) said "Excellence in any department can be attained only by the labor of a lifetime; it is not to be 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 is part of the longer quotation "Ars longa, vita brevis, occasio praeceps, experimentum periculosum, iudicium difficile", which in English renders as "Life is short, [the] craft long, opportunity fleeting, experiment treacherous, judgment difficult."?Of course, no single number can be the final answer: it doesn't seem reasonable to assume that all skills (e.g., programming, chess playing, checkers playing, and music playing) could all require exactly the same amount of time to master, nor that all people will take exactly the same amount of time. As Prof.?K. Anders Ericssonputs it, "In most domains it's remarkable how much time even the most talented individuals need in order to reach the highest levels of performance. The 10,000 hour number just gives you a sense that we're talking years of 10 to 20 hours a week which those who some people would argue are the most innately talented individuals still need to get to the highest level."
So You Want to be a Programmer
Here's my recipe for programming success:
Get?interested?in programming, and do some because it is fun. Make sure that it keeps being enough fun so that you will be willing to put in your ten years/10,000 hours.
Program. The best kind of learning is?learning by doing. To put it more technically, "the maximal level of performance for individuals in a given domain is not attained automatically as a function of extended experience, but the level of performance can be increased even by highly experienced individuals 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 particular 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?is an interesting reference 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 will give you access to some jobs that require credentials, and it will give you a deeper understanding of the field, but if you don't enjoy school, you can (with some dedication) get similar experience on your own or on the job. In any case, book learning alone won't be enough. "Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody 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, has his own?news group, and made enough in stock options to buy his own?nightclub.
Work on?projects with?other programmers. Be the best programmer on some projects; be the worst on some others. When you're the best, you get to test your abilities to lead a project, and to inspire others with your vision. When you're the worst, you learn what the masters do, and you learn what they don't like to do (because they make you do it 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 are not around. Think about how to design your programs to make it easier for those who will 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 (like Lisp or ML or Haskell), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), and one that emphasizes parallelism (like Clojure or Go).
Remember that there is 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 will have 2 or 4 space indentation levels. Either way, you learn about what other people like in a language, how deeply they feel so, and perhaps even a little about why they feel so.
Have the good sense to?get off?the language standardization effort as quickly as possible.
With all that in mind, its questionable how far you can get just by book learning. Before my first child was born, I read all the?How To?books, and still felt like a clueless novice. 30 Months later, when my second child was due, did I go back to the books for a refresher? No. Instead, I relied on my personal experience, which turned out to be far more useful and reassuring to me than the thousands of pages written by experts.
Fred Brooks, in his 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 be responsible for the development of the prospect and carefully keep a career file.
Provide opportunities for growing designers to interact and stimulate each other.
This assumes that some people already have the qualities necessary for being a great designer; the job is to properly coax them along.?Alan Perlis?put it more succinctly: "Everyone can be taught to sculpt: Michelangelo would have had to be taught how not to. So it is with the great programmers". Perlis is saying that the greats have some internal quality that transcends their training. But where does the quality come from? Is it innate? Or do they develop it through diligence? As Auguste Gusteau (the fictional chef inRatatouille) puts it, "anyone can cook, but 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 way 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 anywhere."
So go ahead and buy that Java/Ruby/Javascript/PHP book; you'll probably get some use out of it. But you won't change your life, or your real overall expertise as a programmer in 24 hours or 21 days. How about working hard to continually improve over 24 months? Well, now you're starting to get somewhere...
References
Bloom, Benjamin (ed.)?Developing Talent in Young People, Ballantine, 1985.
Brooks, Fred,?No Silver Bullets, IEEE Computer, vol. 20, no. 4, 1987, p. 10-19.
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 Everyday Life, Cambridge University Press, 1988.
AnswersApproximate timing for various operations on a typical PC:
execute typical instruction1/1,000,000,000 sec = 1 nanosec
fetch from L1 cache memory0.5 nanosec
branch misprediction5 nanosec
fetch from L2 cache memory7 nanosec
Mutex lock/unlock25 nanosec
fetch from main memory100 nanosec
send 2K bytes over 1Gbps network20,000 nanosec
read 1MB sequentially from memory250,000 nanosec
fetch from new disk location (seek)8,000,000 nanosec
read 1MB sequentially from disk20,000,000 nanosec
send packet US to Europe and back150 milliseconds = 150,000,000 nanosec
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. Another choice is Javascript, not because it is perfectly well-designed for beginners, but because there are so many online tutorials for it, such as?Khan Academy's tutorial. But your circumstances may vary, and there are other good choices. If your age is a single-digit, you might prefer?Alice?or?Squeak?or?Blockly?(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.?
翻譯:
十年內(nèi)自學(xué)編程
彼得·諾維格
為什么大家都這么著急?
走進任何一家書店,您將了解如何在 24 小時內(nèi)自學(xué) Java,同時在幾天或幾小時內(nèi)提供無休止的變體來教授 C、SQL、Ruby、算法等。亞馬遜高級搜索 [標(biāo)題: 教, 你自己, 小時, 自: 2000 年以來, 并發(fā)現(xiàn)了 512 這樣的書。前十名中,有九本是編程書籍(另一本是關(guān)于簿記的)。類似的結(jié)果來自將"自學(xué)"替換為"學(xué)習(xí)"或"小時"與"天"。
結(jié)論是,要么人們急于學(xué)習(xí)編程,要么編程比什么都容易學(xué)。Felleisen等人在《如何設(shè)計程序》一書中對這種趨勢點頭,當(dāng)時他們說"糟糕的編程很容易。白癡可以在21天內(nèi)學(xué)會,即使他們是假人。阿布特魯斯鵝漫畫也有他們采取。
讓我們分析一下 24 小時內(nèi)"C++"標(biāo)題可能意味著什么:
教導(dǎo)自己:在24小時內(nèi),你將沒有時間寫幾個重要的程序,并學(xué)習(xí)你的成功和失敗與他們。您沒有時間與經(jīng)驗豐富的程序員合作,并了解生活在一個良好的環(huán)境中C++??傊?,你將沒有時間學(xué)習(xí)太多。所以這本書只能說是膚淺的熟悉,不能是深刻的理解。正如亞歷山大·波普說的,一點學(xué)習(xí)是危險的事情。
C++:在24小時內(nèi),你也許能夠?qū)W習(xí)C++的一些語法(如果你已經(jīng)知道另一種語言),但你不能學(xué)到很多如何使用的語言。簡言之,如果你是一個基本程序員,你可以學(xué)會用C++語法編寫基本風(fēng)格的程序,但是你不能學(xué)習(xí)C++實際上是好(和壞)什么。那有什么意義呢?艾倫·佩利斯曾經(jīng)說過:"一種不影響你編程方式的語言,不值得了解。一個可能的觀點是,你必須學(xué)習(xí)一點點C++(或者更可能,像JavaScript或處理),因為你需要與現(xiàn)有的工具接口來完成一個特定的任務(wù)。但是,你并沒有學(xué)習(xí)如何編程;你正在學(xué)習(xí)完成那個任務(wù)
在24小時:不幸的是,這是不夠的,如下一節(jié)顯示。
十年內(nèi)自學(xué)編程
研究人員(Bloom(1985年)、布萊恩和哈特(1899年)、海耶斯(1989年)、西蒙和蔡斯(1973年))表明,在象棋、音樂創(chuàng)作、電報操作、繪畫、鋼琴演奏、游泳、網(wǎng)球以及神經(jīng)心理學(xué)和拓?fù)鋵W(xué)研究等許多領(lǐng)域,大約需要10年時間。關(guān)鍵是審議實踐:不只是一次又一次地做,而是用一個超出你當(dāng)前能力的任務(wù)來挑戰(zhàn)自己,嘗試一下,在做之后分析你的表現(xiàn),并糾正任何錯誤。然后重復(fù)。再重復(fù)一遍似乎沒有真正的捷徑:即使是4歲時音樂神童的莫扎特,也花了13年時間才開始創(chuàng)作世界級的音樂。在另一種類型中,披頭士樂隊似乎以一連串的#1和1964年埃德·沙利文的時裝秀而登上舞臺。但是他們自1957年以來一直在利物浦和漢堡打小俱樂部,雖然他們很早就有大眾的吸引力,但他們的第一次重大成功,佩珀斯中士,在1967年被釋放。
馬爾科姆·格拉德威爾已經(jīng)推廣了這個想法,盡管他專注于10,000小時,而不是10年。亨利·卡蒂埃-布雷森(1908-2004)還有另一個指標(biāo):"你的前10,000張照片是你們最差的。"(他沒想到,使用數(shù)碼相機,有些人可以在一個星期內(nèi)達到這個目標(biāo)。真正的專業(yè)知識可能需要一生的時間:塞繆爾·約翰遜(Samuel Johnson,1709-1784)說:"任何部門都只有一生的勞動才能取得卓越成就;它不應(yīng)該以較低的價格購買。喬瑟 (1340 - 1400) 抱怨道: "萊夫這么短, 工藝這么久, 對勒恩來說。Hippocrates (c. 400BC) 以摘錄 "ars longa, vita brevis" 而廣為人知, 這是較長語錄 "阿爾斯 · 朗加, 維塔 · 布雷維斯, 偶爾練習(xí), 實驗腹膜, 膽汁困難" 的一部分, 在英語中渲染為 "生命是短暫的, [the] 工藝長, 機會轉(zhuǎn)瞬即逝, 實驗背信棄義, 判斷困難" 。當(dāng)然,沒有一個數(shù)字可以是最終的答案:似乎不合理地假設(shè)所有技能(如編程、棋牌、跳棋和音樂演奏)都需要完全相同的時間來掌握,也不認(rèn)為所有人都需要完全相同的時間。正如安德斯·愛立信教授所說,"在大多數(shù)領(lǐng)域,即使是最有才華的個人也需要多少時間才能達到最高水平,這一點令人矚目。10,000 小時的數(shù)字只是讓您感覺到,我們談?wù)摰氖敲恐?10 到 20 小時,有些人會認(rèn)為這些人是天生的天才人才,仍然需要達到最高水平。
所以你想成為一名程序員
以下是我的編程成功秘訣:
對編程感興趣,并做一些,因為它很有趣。確保它一直足夠有趣,這樣你才愿意投入你的十年/10,000小時。
程序。最好的學(xué)習(xí)就是通過做學(xué)習(xí)。更技術(shù)上說,"給定領(lǐng)域中個人的最高績效水平不是作為擴展經(jīng)驗的函數(shù)自動實現(xiàn)的,但即使經(jīng)驗豐富的個人,由于經(jīng)過深思熟慮,可以提高績效水平。羅夫。(第366)和"最有效的學(xué)習(xí)需要一個明確界定的任務(wù),對于特定的個人,信息豐富的反饋,以及重復(fù)和糾正錯誤的機會,具有適當(dāng)?shù)碾y度級別。(第20-21號)《實踐認(rèn)知:日常生活中的思維、數(shù)學(xué)和文化》一書是這一觀點的有趣參考。
與其他程序員交談;閱讀其他程序。這一點比任何書籍或培訓(xùn)課程都重要。
如果你想的話,在一所大學(xué)里工作四年(或者多在研究生院)。這將讓您訪問一些需要證書的工作,并讓您更深入地了解該領(lǐng)域,但如果您不喜歡學(xué)校,您可以(有一些奉獻精神)獲得類似的經(jīng)驗,自己或工作。無論如何,單靠書本學(xué)習(xí)是不夠的。《新黑客詞典》的作者埃里克·雷蒙德(Eric Raymond)說:"計算機科學(xué)教育不能讓任何人成為專家程序員,更不能讓任何人成為專家程序員,更不能讓任何人成為專家畫家。我雇傭過的最好的程序員之一只有高中學(xué)位;他制作了很多偉大的軟件, 有自己的新聞集團, 并做了足夠的股票期權(quán), 以購買自己的夜總會。
與其他程序員一起處理項目。成為某些項目的最佳程序員;是其他人最差的。當(dāng)你是最好的,你可以測試你的能力,領(lǐng)導(dǎo)一個項目,并激勵別人與你的遠見。當(dāng)你是最差的時候,你學(xué)習(xí)主人做什么,你學(xué)習(xí)他們不喜歡做什么(因為他們讓你為他們做)。
在其他程序員之后處理項目。了解其他人編寫的程序。看看當(dāng)原始程序員不在的時候,需要什么來理解和修復(fù)它??紤]如何設(shè)計程序,使那些在您之后維護程序的人更容易。
學(xué)習(xí)至少六種編程語言。包括一種強調(diào)類抽象的語言(如Java或C++)、一種強調(diào)函數(shù)抽象的語言(如Lisp或ML或哈斯克爾)、一種支持句法抽象的語言(如Lisp)、一種支持聲明性規(guī)范(如Prolog或C++模板)的語言,以及一種強調(diào)并行性的語言(如Cljure或 Go)。
請記住,"計算機科學(xué)"中存在"計算機"。了解計算機執(zhí)行指令、從內(nèi)存中獲取單詞(有和沒有緩存錯過)、從磁盤讀取連續(xù)單詞以及查找磁盤上的新位置需要多長時間。(答案在這里。
參與語言標(biāo)準(zhǔn)化工作。它可能是 ANSI C++,也可以決定您的本地編碼風(fēng)格是否具有 2 或 4 個空間縮進級別。無論哪種方式,你都了解別人喜歡的語言,他們感覺有多深,甚至一點點關(guān)于他們?yōu)槭裁催@樣的感覺。
有好感,盡快擺脫語言標(biāo)準(zhǔn)化工作。
想到這一切, 你只要通過書本學(xué)習(xí)能多遠, 就值得懷疑了。在我的第一個孩子出生之前,我讀了所有的《如何》一書,仍然覺得自己是一個無知的新手。30 個月后, 當(dāng)我的第二個孩子到期時, 我回到書本上復(fù)習(xí)一下嗎?不。相反,我依靠我個人的經(jīng)驗,事實證明,這比我有用和放心得多,比專家寫的數(shù)千頁。
弗雷德·布魯克斯在他的論文《沒有銀彈》中確定了尋找偉大軟件設(shè)計師的三部分計劃:
盡早系統(tǒng)地確定頂級設(shè)計師。
指派一位職業(yè)導(dǎo)師負(fù)責(zé)潛在客戶的發(fā)展,并仔細保存職業(yè)檔案。
為成長的設(shè)計師提供互動和刺激的機會。
這假定有些人已經(jīng)具備成為偉大設(shè)計師所需的素質(zhì);工作是正確地哄他們一起。艾倫·佩利斯說得更簡潔:"每個人都可以被教導(dǎo)去雕刻:米開朗基羅必須被教導(dǎo)如何不雕刻。因此,這是與偉大的程序員"。佩利斯說,偉大的球員有一些超越他們訓(xùn)練的內(nèi)部素質(zhì)。但是質(zhì)量從何而來呢?是天生的嗎?還是他們通過勤奮來發(fā)展?正如奧古斯特·古斯托(拉塔圖耶虛構(gòu)的廚師)所說,"任何人都可以做飯,但只有無所畏懼的人才能是偉大的。我認(rèn)為更多的是愿意把一生中的很大一部分用于審議實踐。但也許無所畏懼是總結(jié)這一點的一種方式?;蛘?,正如古斯托的批評家安東·埃戈所說:"不是每個人都能成為一個偉大的藝術(shù)家,但一個偉大的藝術(shù)家可以來自任何地方。
因此,繼續(xù)購買 Java/Ruby/Javascript/PHP 書籍;你可能會從中得到一些利用。但你不會改變你的生活,或者你作為程序員在24小時或21天內(nèi)真正的整體專業(yè)知識。努力在24個月內(nèi)不斷改進怎么樣?現(xiàn)在你開始找個地方了...
引用
布魯姆,本杰明(Ed.)培養(yǎng)年輕人的人才,巴蘭廷,1985年。
布魯克斯, 弗雷德, 沒有銀彈, IEEE 電腦, 第 20 卷, 第 4 號, 1987 年, 第 10 - 19 周。
布萊恩, W. l. – 哈特, N. "關(guān)于電報語言的研究: 獲得習(xí)慣的層次。心理學(xué)評論, 1899, 8, 345-375
海斯,約翰R.,完全問題解決者勞倫斯·埃鮑姆,1989年。
蔡斯, 威廉 G. & 西蒙, 赫伯特 A. "國際象棋感知" 認(rèn)知心理學(xué), 1973 年, 4, 55 - 81 。
拉夫,讓,實踐認(rèn)知:思維,數(shù)學(xué)和文化的日常生活,劍橋大學(xué)出版社,1988年。
答案
典型 PC 上各種操作的大致計時:
執(zhí)行典型指令 1/1,000,000,000 秒 = 1 納米秒從 L1 緩存內(nèi)存 0。5 nanosec 分網(wǎng)預(yù)測錯誤 5 納米秒從 L2 緩存存儲器 7 nanosecMutex 鎖 / 解鎖 25 nanosecfetch 從主存儲器 100 nanosecsend 2K 字節(jié)超過 1Gbps 網(wǎng)絡(luò) 20,000 nanosecread 1MB 順序從內(nèi)存 250,000 從新的磁盤位置 (尋求) 8,000,000 nanosecread 1MB 順序從磁盤 20,000,000 nanosec 發(fā)送數(shù)據(jù)包美國到歐洲和回 150 毫秒 = 150,000,000 nanosec
附錄:語言選擇
有幾個人問他們應(yīng)該先學(xué)什么編程語言。沒有一個答案,但請考慮以下幾點:
用你的朋友。當(dāng)被問及"我應(yīng)該使用什么操作系統(tǒng),Windows,Unix,還是Mac?從朋友那里學(xué)習(xí)的好處將抵消操作系統(tǒng)之間或編程語言之間的任何內(nèi)在差異。還要考慮你未來的朋友:如果你繼續(xù),你將成為其中一員的程序員社區(qū)。您選擇的語言是有一個龐大的成長社區(qū)還是一個垂死的小社區(qū)?是否有書籍、網(wǎng)站和在線論壇可以獲得答案?你喜歡那些論壇里的人嗎?
保持簡單。編程語言(C++ 和 Java)是由經(jīng)驗豐富的程序員團隊為專業(yè)開發(fā)而設(shè)計的,他們關(guān)注代碼的運行時效率。因此,這些語言具有專為這些情況設(shè)計的復(fù)雜部分。你關(guān)心的是學(xué)習(xí)編程。你不需要這種并發(fā)癥。您想要一種由單個新程序員設(shè)計得易于學(xué)習(xí)和記憶的語言。
玩。你寧愿學(xué)習(xí)哪種方式彈鋼琴:正常的互動方式,你一點擊一個鍵,或"批"模式,你只聽到音符后,你完成了一整首歌?顯然,交互式模式使鋼琴和編程的學(xué)習(xí)更加容易。堅持使用交互式模式的語言并使用它。
鑒于這些標(biāo)準(zhǔn),我對第一種編程語言的建議將是Python或S方案。另一個選擇是Javascript,不是因為它是為初學(xué)者設(shè)計得完美的,而是因為有這么多的在線教程,如Khan學(xué)院的教程。但是,你的情況可能會有所不同,還有其他不錯的選擇。如果你的年齡是一位數(shù),你可能更喜歡愛麗絲或吱吱聲或塊(年齡較大的學(xué)習(xí)者也可能喜歡這些)。重要的是你選擇并開始。
附錄:書籍和其他資源
有幾個人問他們應(yīng)該從哪些書籍和網(wǎng)頁中學(xué)習(xí)。我再說一遍, "單靠書學(xué)習(xí)是不夠的", 但我可以推薦以下內(nèi)容:
方案:計算機程序的結(jié)構(gòu)和解釋(Abelson & Sussman)可能是計算機科學(xué)的最佳介紹,它教編程作為理解計算機科學(xué)的一種方式。您可以在線查看有關(guān)本書的講座視頻,以及完整的文本。這本書很有挑戰(zhàn)性,將一些人從另一種方法中去掉。
方案:如何設(shè)計程序(Felleisen等人)是有關(guān)如何以優(yōu)雅和實用的方式實際設(shè)計程序的最佳書籍之一。
Python: Python 編程: 使用 Python 的 Cs 簡介 (Zelle) 是一個很好的介紹。
Python:在一些在線教程Python.org。
奧茲: 計算機編程的概念、技術(shù)和模型 (范羅伊和哈里迪) 被一些人視為阿貝爾森和蘇斯曼的現(xiàn)代接班人。這是一個通過編程的大想法之旅, 涵蓋比亞伯森和蘇斯曼更廣泛的范圍, 而也許更容易閱讀和遵循。它使用一種語言,Oz,這是不廣為人知,但作為學(xué)習(xí)其他語言的基礎(chǔ)。<
筆記
T. Capey指出,亞馬遜上的"完全問題解決者"頁面現(xiàn)在有"在21天內(nèi)自學(xué)孟加拉語"和"自學(xué)語法和風(fēng)格"的書籍下"為這個項目購物的顧客也為這些物品購物"部分。我猜看那本書的人很多來自這個頁面。感謝羅斯·科恩對希波克拉底的幫助。