学习新的编程语言的重要性

今天在Good Programmers Makes Bad Designer(好的程序员是坏的设计师)一文中看到这样一段话:

If you focus only on one language to gain proficiency in it, you will be restricted to the paradigm of the problem domain for which your language was designed. In short, if all you know is PHP, then every programming problem starts to look like Web development problems. In the same manner, if Java is all you know, you will try to approach every problem from the object-oriented standpoint even if the problem is better solved using procedural programming as in the majority of systems programming.

Knowing only one or even two programming languages as good programmers should, will severely limit your capability to solve problems. For example, if your language is C, you will find it very difficult to think of the problem at hand in an object-oriented way because your programming language does not readily provide that functionality. Unlike Haskell programmers, C++ programmers cannot approach a problem the functional way either. Whether your programming language offers structs and enums or not can greatly affect how you attempt to dissect the problem. If your language is inadequate or if you only know a few languages, your ability to solve problems efficiently will likewise be hampered.

我所理解的这段话的大致意思是说精通并专注于一两种编程语言的程序员在解决问题时候会有思维的局限性,只会使用最熟悉的工具而不是最好的工具来做事情,但是对于设计师来说,这并不是一个好现象。

对于全文的观点我有些不是很赞同,但是对于这段话的观点,我是很同意的。

一直以来,网上都有很多语言之争,例如.Net和Java之争,现在的Ruby和Java之争等等。有人会觉得很奇怪,觉得语言只是一个实现工具,更重要的是解决方案的设计。我觉得这个说法也对也不对。首先我觉得没有哪个语言绝对比另外的一种语言好,很多语言都是为了解决特定的领域的问题而设计的。没有哪个语言是十全十美的,一方面的提升通常是以另外一方面的牺牲作为代价的。另外一方面,就是因为语言的特性,对程序员的思维会有潜移默化的影响,语言的特性对于解决方案也会有影响。

著名的计算机科学家Edsger Dijkstra有一段话:

A most important, but also most elusive, aspect of any tool is its influence on the habits of those who train themselves in its use. If the tool is a programming language this influence is, whether we like it or not, an influence on our thinking habits. — Edsger Dijkstra, computer scientist
关于工具,一个最重要的,也是最不易察觉的方面是,工具对使用此工具的人的习惯的潜移默化的影响。如果这个工具是一门程序语言,不管我们是否喜欢它,它都会影响我们的思维惯式。

有些时候在一个语言中很难解决的问题,在另外一个语言中只是基本的知识。学习一门新的语言,通常会有一种感觉:“哦,原来事情还可以这样做!”而且伟大的语言背后,通常会有一些伟大的思想,这些思想更是架构师要重点学习的地方。

我使用Java很多年了,最近也是觉得有思想僵化的倾向。同时也想起了《程序员修炼之道》里面的建议,因此决定要学习一下其他的语言。初步的语言学习计划是首先将以前学习过但没有深入的c/c++重新学习一边,然后学习一下.Net(主要是框架和C#),然后是流行的Ruby。并不是说要将这些语言学习的有多么精通,但是至少要知道这些语言有什么特点,能解决什么问题。

还是那句话,作为一个架构师,需要有广泛的知识,才能使用最方便的工具设计出合理的解决方案。

你可能感兴趣文章
        除标明转载的文章之外,其他的文章都是本站原创。在注明文章来源的前提下,欢迎转载本站原创文章。

关于 Wings

普通的IT从业人员 热爱技术 热爱阅读与旅游
此条目发表在 架构师之路, 程序员修养 分类目录,贴了 , , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>