Turn ten years to learn programming

Why is everyone in such a hurry?

Walk into any bookstore, you will see a row of books such as "Learning Java Language by Oneself in 7 Days" and learning Windows, Internet or Visual Basic in a few days or hours on the bookshelf. I use the following methods for advanced search in Amazon online bookstore :

Publication year: After 1992, the title of the book includes: "天" and "study" or "self-study"

I got 268 search results, of which the first 78 are computer books (the 79 is to learn Bengali in 30 days ).

I used " hour " instead of "day" as the keyword, and got magically similar results: this time there are 253 books, the first 77 are computer books, and the 78th is a 24-hour self-study of grammar and writing style . 96% of the top 200 books are computer books.

It can be seen that people are either eager to learn computers, or computers are too easy to learn compared to other things. For example, there is no book about playing Beethoven in a few days or learning quantum physics in a few days, or even learning how to dress up a puppy in a few days.

Let's analyze what  the title of " Learning Pascal Language in Three Days" [English Page] means:

1. Learn to:

In three days, you don't have time to write a few meaningful programs or learn from successes and failures. You don't have time to work with experienced programmers, so you can't understand what programming is like in real life. In short, as far as learning is concerned, time is obviously not enough. So these books are just superficial familiarity, not deep understanding. As Alexander Pope said, half-knowledge is dangerous.

2. Pascal language:

You may learn the grammar of the Pasacl language in three days (if you have mastered a similar programming language), but you cannot learn how to use the grammar properly. In short, if you are a Basic programmer, you can write programs similar to Basic style in Pascal, but you can't learn the advantages (and disadvantages) of Pascal. What's the point?

Alan Perlis once said: "If a programming language cannot affect your programming thinking, it is not worth learning."

Another possibility is that you have to learn a little Pascal language (or like VB language, Javascript, etc.), because you need to combine with existing tools to complete specific tasks. But at this time, what you actually learn is not how to write programs, but how to complete work.

3. Three days

Unfortunately, three days is not enough; the following chapters will tell you why

Ten years of learning programming

Researcher  HayesBloom  ’s research shows that in almost all fields, it takes about ten years to develop professional skills. These fields include chess, music composition, painting, piano, swimming, tennis, and neuropsychology and mathematical topology. There seems to be no real shortcut-even if Mozart showed his musical genius at the age of four, it took more than thirteen years before he wrote world-class music.

Look at another type of field. It seems that the Beatles suddenly became the first band in the Ed Sullivan Theater in 1964. But in fact, they have been performing in small clubs in Liverpool, Hamburg and other places since 1957. Although they showed strong appeal early on, their decisively successful work  Sgt Pepper  was not released until 1967. Samuel Johnson believes that it may take more than ten years. He said: Excellence in any field must be achieved with a lifetime of hard work; a slightly lower price cannot be exchanged. Chaucer exclaimed: "Life is so short, but learning skills takes so long."

The following is my secret to success in programming:

  • 对编程产生感兴趣并因为乐趣而写程序。确信你自始至终都能乐在其中,这样你才愿意将十年光阴投入编程事业.
  • 与其他程序员交流;阅读别人的代码。这比任何书任何培训都重要。
  • 不断地编写。最好的学习方法是在实践中学习。从技术角度说,”在特定领域的个人最高效率并不因为经验够多就会自动获得;但若有意识的通过努力去提升经验,个人效率会变高”(第336页)而“高效的学习一般需要明确的任务和因人而异的适当难度,以及及时的反馈和重复或者修正错误的机会”(20~21页)Cognition in Practice: Mind, Mathematics, and Culture in Everyday Life实践中认知:心智、数学与日常文化)是这个观点的一本有趣参考书籍。
  • 如果你愿意,你可以去读四年大学(或再读研究生)。这可以让你满足一些工作的学历要求,同时也可让你对这个领域有更深的认识。但如你不喜欢上学,你也能(得有牺牲)通过工作获得类似的经验。无论如何,只读书是不够的。《New Hacker’s Dictionary》的作者Eric Raymond 曾经说过:“计算机的教育无法让人成为编程的专家,正如研究画笔与颜料不能让人成为专业画家一样.” 一个在我所有招聘过的人中属于最优秀之一的程序员只有高中毕业,但他写出很多很棒程序,他甚至有自己的新闻组。他获得的股票期权使得他可以拥有自己的午夜酒吧.
  • 跟其他程序员一起完成项目。在一些项目中成为最好的程序员;在一些中则充当最差的一个。当你是最佳的,你要测试自己领导项目的能力,并以你的能力鼓励他人。当你是最差的,要看看高手做些什么,他们不喜欢做什么(因为他们会叫你去帮他们做).
  • 接手别的程序员完成项目。全心投入并理解别人的程序。当原作者不在的时候,看看在理解与修改时有什么要注意的。想想如何设计你的程序使得后来维护的人容易上手。
  • 至 少学会六门编程语言。一种要支持类/对象(class abstractions)的语言,如Java或C++; 一种函数式(functional abstraction)语言, 如 LISP 或 ML;一种支持语法抽象(syntactic abstraction) 的语言 如 LISP;一种声明式语言, 如Prolog或 C++模版; 一种支持协同式(coroutines)编程,如 Icon 或 Scheme; 还有一种支持并行(parallelism)的语言, 如 Sisal.
  • 记住在 “计算机科学” 中包括”计算机”这个词。要知道你的计算机执行一条指令需要多久,到内存中取一个字需要多久(缓存是否击中),到磁盘读取连续的字需要多久,而磁盘的定位又需要多久. (解答见文末)
  • 进行语言标准化的工作。可以像是由ANSI C++委员会,或由你自己的团队,来决定你们的编码风格,譬如说缩排是2或4个空格。不管怎样,你都能学到别人到底喜欢什么,对语言的感受有多深,甚至能了解到一点他们为什么有这样的感觉。
  • 并具备良好的判断力,也别老纠缠在语言标准化上.

谈了上面所有的想法后,我不禁要问究竟能从书上学到多少。在第一个孩子出生前,我读完了所有的“怎样…”的书,仍觉得自己是个一无所知的(照顾孩子的)菜鸟。30个月后,第二个孩子出世,我要重回这些书好好复习么?

不!取而代之的是,我开始相信自己的个人经验。这些难得的经验,比专家写的几千页手册还要有用,而且让我重新找到了自信.

Fred Brooks (译注: 《人月神话》作者) 在他的文章没有银弹中指出,发掘卓越软体设计者的三部曲:

  1. 尽早尽可能地以系统化的方式发掘最佳设计人员。
  2. 给有潜力者指派生涯规划师,并谨慎地规划他们的职业生涯。
  3. 提供机会给正在成长的程序员,让他们能相互影响,彼此激励。

这里假定了某些人已具备成为卓越设计师的必要潜能;工作只是诱导他们前进。 Alan Perlis 说得更简洁了,你可以教任何人学雕塑,但对米开朗基罗而言,要教他的反倒是有哪些事不要做, 卓越的程序员也一样。

所以,尽管买那些 Java书吧!你或许能从中找到点有用的,但是在24小时,几天或者几个月中,这些都不会改变你的人生,你也不能掌握一个真正的程序员应该具备的真正的综合的技能。

参考文献

解答

各种操作的时间,以2001年夏季,典型配置的 1GHz 个人计算机为标准:

命令 速度
执行单一指令 1 纳秒
从L1 高速缓存取一个字 2 纳秒
从内存取一个字 10 纳秒
从磁盘取连续存放的一个字 200 纳秒
磁盘寻址并取字 8 毫秒

附录 I: 语言的选择

好几个人问过我一开始应该先学哪个计算机编程语言,这个问题没有唯一的答案,不过选择的时候可以从以下的几个方面考虑:

  • 朋友在用的. 当人们问我:”我该用什么操作系统的时候”,我通常的回答是:“用你朋友用的”.这样的好处是从朋友那儿学习可以弥补复杂的操作系统差异或者编程语言差异(给你造成的困惑)。这里也要考虑你未来的朋友:如果你一直使用的话,开发社区会是你的朋友。你选择了一个具有有巨大的增长的开发社区还是一个小的快消失的开发社区的语言?它有相关的书,网站和论坛可以获取解答么?你喜欢那些论坛上的人么?
  • 保持简单.诸如C++和Java是为那些关心代码执行效率的有经验的大型团队的开发人员设计的。因此这些语言中有些为这些特殊场合设计的部件。你只是关心编程而不需要关心复杂情况。你需要一个为新学编程的人设计的容易学习和理解的语言。
  • 实践.什么是学习钢琴的好方法呢?
    是一边听音一边弹奏的“交互式”的方法呢,还是全听完整首歌然后再弹奏的那种“批处理”方式呢? 很显然,交互学习的方式能够让学钢琴变得简单–这也适用于编程.选取一种交互式的编程语言并且坚持使用.

基于以上的这些标准,我对于第一次接触编程的人推荐 Python 或 Scheme.但是情况各有不同,或许也有其他的选择. 如果你不满10岁,你可能会喜欢Alice或者Squeak(年龄大的人或许也喜欢这些). 重要的是在选择后,立即开始学习和使用.

附录II: 书和其他资源:

很多人问我该从什么书或者什么网页开始看起。我重申一句:“仅仅看书是不够的”,不过我也推荐一下的一些:

Note: T. Capey pointed out that people who bought this book on Amazon's problem solver's page also bought: "Learn Bengali in 21 Days" and "Teach Yourself Grammar and Writing Style". I guess Most of them are the users I brought to this page.

Guess you like

Origin blog.csdn.net/u011105442/article/details/50520298