The Internet Workplace: How Programmers Choose a Second Language

 

  Many people love to argue about what to learn for the first programming language. Everyone's starting point is different. Some people think that the first language should be interesting and has no entry barriers; some people think that the first language affects the way of thinking of subsequent program development, which should be rigorous and thoughtful; some people take practicality as the starting point , thinks it will be better depending on (future) work and circumstances.

  It seems that either starting point is correct, but in the field of program development today, developers are bound to learn multiple languages. There are many disputes about the first language, but few people talk about what to learn in the second programming language.

  Looking back, under what circumstances did your first language start, did you have a chance to choose?

  Many people have no choice when it comes to their first language. Most of them choose the language that is considered to have more job opportunities because of school-specified courses or work needs, or to change jobs.

  If it is the language that will be used in the specified courses of the school, it will most likely involve the language that the professor lays the foundation for the program, or the language that can be used after graduation. If the school chooses a language that can lay the foundation for program development, sometimes it will be labeled as a gap between industry and academia, and then some people will rush to bring the current practical language to the campus, but there is more than one practical language in the industry. Taking reality as the premise will lead to the dilemma that some schools learn one language for one semester, and they learn three or four languages ​​before graduation, but they cannot understand everything.


 

  However, after entering the job, you are often required to do in-depth research on the language of the job you are responsible for. For example, one of the three current high-quality developers in the Programmer Inn www.proginn.com is one of the three web back-end developers: Obviously, the previous school was learning java. , and later worked in web development, so he was very proficient in PHP (above)

  Turing Award winner Edsger W. Dijkstra wrote a letter to the University of Texas Budget Committee in 2001 (you can search "Dijkstraon Haskell and Java" to find a PDF link to this letter), urging them not to use university programs to develop The functional programming language Haskell used in the introductory course has been changed to the imperative language Java. One of the reasons for its practicality is that for freshmen courses, most students have a certain degree of familiarity with imperative programming. Faced with functional languages, they can immediately discover that there are still many things they have not thought about in program development.

  Dijkstra sees Java as a hodgepodge, achieved market acceptance through heavy advertising and aggressive sales practices; he says: "It's not just the violin that shapes the violinist, the tools we train ourselves to use also shape us, and in programming Language has a profound effect on this, and it shapes our thinking habits."

  In addition to laying the foundation or practical investigations, some people are more selective. They can choose the first language based on interest or sense of accomplishment. The basics of program development or practicality are not necessarily the main investigations. They think that interest and sense of accomplishment are talents. Motivation for learning.

  In today's era when everyone should learn program development and should learn program development from a young age, some people try to select some languages ​​with few grammar details, low operating thresholds, and remarkable results, in order to reduce the frustration of new language learners and let them In the process of learning, you can always get a sense of achievement, so you can develop your interest and even ability in program development.

  Can re-understand the language of programming

  Based on different starting points, you may have experienced your first or even multiple language choices (or no choice), and if you have the opportunity to do it all over again, suppose you now have the opportunity to choose a second language, or you are facing or Suggest him what to learn as a second language, how would you choose?

  Saying it is a choice is not entirely an autonomous choice. After all, the influence of the first language, sometimes like a mother tongue, will still affect our choice of the second language. My suggestion is that since the first language It will inevitably affect the choice of the second language. From a long-term perspective, the second language is not as good as the first language, and it can re-understand the language of program development.

  Many studies have pointed out that the language humans use affects our perception of the world, and people who use different languages ​​will think differently. In the field of program development, Dijkstra also talked about a very important point, the programming language shapes our thinking habits. When you use the first language, you see the programming world from its perspective. If the second language adopts a similar perspective to the first language, the world you see will not be much different. Only by looking at the language of the programming world can you see the other side of the programming world.

  If your first language is a statically stereotyped language, then try to learn dynamic stereotyping in the second one, and understand the elasticity of dynamic stereotypes. Think more rigorously about patterns.

  如果第一门语言以面向对象为主要典范,那么第二门就学习以函式为中心的语言。如果第一门语言是命令式,那么就第二门就来了解函数式风格的语言。如果是处处以语法作出限制的语言作为第一门,那就以随时依赖惯例的语言作为第二门。如果你是基于工作选择了第一门语言,那么就基于兴趣来选择第二门语言。倘若你进入门槛低的语言是第一门,那么考虑找个进入门坎高的语言来做为第二门……

  以相对于第一门的角度来选择第二门语言,往往有如骤然面临巨大陌生环境,这迫使你重新体会第一门语言刚开始时的步履蹒跚,你得从相对角度重新认识程序开发的世界,这样才有机会重新塑造思考习惯,也才能体验到Dijkstra在信中谈到的,程序开发还有许多你没有想过的东西,因为重新认识程序开发,你才有机会开始在程序开发上重复练习。

  程序世界中的重复练习

  在练习小提琴时,经常要反复地练习某个曲子,直到每个动作连贯而流畅,练习书法时,必须重复地练习临摩书法家的名帖,不少技艺都需要透过重复性的练习来熟悉基本动作,为将来更高超技巧奠定基础,同样地,每个卓越运动家的成就,都必然历经过十万个小时以上的练习,那么,在程序开发的世界中,有这种形式的重复练习吗?维基百科上有个〈Kata(programming)〉条目谈到,code kata可以让程序开发者透过练习与重复来磨练技能。

  第一个将日本武术中Kata概念带入程序开发领域的人,可能是《ThePragmatic Programmer》共同作者之一DaveThomas,他建立了CodeKata(codekata.com),目前提供了21个简短的Kata练习,有些练习必须进行程序开发,然而撰写代码上可以有多种不同方式,有些重点不在程序开发,而在思考方式,正确答案也不只一个,你可以重复进行这些练习,这里练习的目标不在最后的解答,而是在练习的过程。Bob大叔在《The Clean Coder》中谈到Kata时也讲到:「练习者不是在解决真正的问题,因为你已经知道解决方案。相反地,你是在练习解决这个问题时,需要的动作和决策」。

  当你在历经第一门语言的洗礼之后,对于某些问题,也许已经知道该语言如何解决,因此第二门语言在选择时,若能挑选差异性大的语言,就可以借此换个角度来思考,重新训练你解决问题时的动作和决策。此时,除了从语法上来重新思考之外,也要从语言社群的文化与惯例来思考,如此一来,就算是基础的数据结构与算法,也可以进行重复练习而从中获得不同的思考方式,我先前专栏〈数据结构与算法的七个思考术〉,谈到的就是这类的概念。

  一年经验续用九年vs.十万个小时的练习

  有人反对CodeKata的概念,认为程序开发领域中重复解决相同的问题集合,并不会带来任何进步,持有的对照示例像是:有人就算开了一辈子的车,也不会成为车神,也有人从戏谑角度说到「我只有一年经验,但又重复用了九年,这听来很糟,但是十万个小时的重复练习听来就很威」,这样的比喻并不正确,重点并不在于重复。

  如同小提琴每一次的练习,虽然看似重复,然而每次都得尝试在重复中找到动作中需要改进的地方,或者更有效率的按弦方式等,才算是练习,如果每次都只是不假思索、单纯地重复,没有任何困难度与挑战性在里头,那就只是一年经验续用九年的重复,如果每次重复都加入了自我挑战与困难度,那才会是十万个小时的练习。

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326751209&siteId=291194637
Recommended