学习的方法论一:知识溯源法

有一千个读者,就有一千个哈姆雷特

什么是知识溯源法

在学习本方法之前我们先来看看百度百科的定义。

溯源法是一种追究根源的逆向思维方式,也是一种以倒推的方式追寻原因而达到解决问题的工作方式。

我的理解就是对知识的起源做一个探寻。计算机的历史距今也不算太久,第一台图灵完备的电子计算机ENIAC诞生于1946年,所以计算机编程的相关知识大多都是可溯源的。

为什么要对知识进行溯源

可以帮助我们了解该知识出现的历史背景,为什么会出现以及该知识所带来的影响。虽然网上现在的资料多到数不胜数,其中也不乏有一些大佬们的总结,读这些文章固然可以帮我们理解该知识点(站在巨人的肩膀上),但如果我们能拿到第一手资料的话或许我们会有一些不一样的理解(有一千个读者就有一千个哈姆雷特)。

怎么对知识进行溯源

下面我会以对面向对象编程(object-oriented programming)这个概念进行溯源为例:

  1. 通过google查询object-oriented programming出现的历史,我在维基百科(wikipedia)中找到了这个词的History。摘抄部分如下:

    Terminology invoking “objects” and “oriented” in the modern sense of object-oriented programming made its first appearance at MIT in the late 1950s and early 1960s. In the environment of the artificial intelligence group, as early as 1960, “object” could refer to identified items (LISP) atoms) with properties (attributes);Alan Kay was later to cite a detailed understanding of LISP internals as a strong influence on his thinking in 1966

    大概意思就是面向对象这个术语最早出现在19世纪50年代末到60年代初,后来Alan Kay这个人详细的解释了这个术语的含义。

  2. 随后我在谷歌学术找到了Alan Kay发给别人的邮件阐述他对于object-oriented programming的理解。原文在这里,摘抄部分如下:

    OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other
    systems in which this is possible, but I’m not aware of them.

    大概意思就是面向对象操作仅意味着消息传递,本地保留和保护以及隐藏状态过程。

    I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning – it took a while to see how to do messaging in a programming language efficiently enough to be useful).

    正如Alan Kay说的,每个对象就像生物细胞那样,只负责消息传递,而代谢的任务则由细胞内部完成,外部不必介入。这不正是面向对象编程的三大特性之一的封装么。

    The term “polymorphism” was imposed much later (I think by Peter Wegner) and it isn’t quite valid.

  3. Alan Kay提到他认为多态性是由Peter Wegner提出的,所以接下来继续通过谷歌学术搜到了这个人的论文

    《Concepts and paradigms of object-oriented programming》。论文中提到

    Inheritance is a mechanism for sharing and reusing behavior. It is distinguished from other behavior sharing mechanisms by delayed binding of self-reference so that
    superclasses may merge their identity with the subclasses that inherit them.

    大概含义就是继承是共享和重用行为的一种机制,它与其他行为共享机制的区别在于延迟了对自我参照的绑定,所以父类可以将其与继承它们的子类合并。

  4. 而在他的论文《On understanding types, data abstraction, and polymorphism》可以找到他对于多态性的解释,摘抄如下:

    Conventional typed languages, such as Pascal, are based on the idea that functions and procedures, and hence their operands, have a unique type. Such languages are said to be monomorphic, in the sense that every value and variable can be interpreted to be of one and only one type. Monomorphic programming languages may be contrasted with polymorphic languages in which some values and variables may have more than one type. Polymorphic functions are functions whose operands (actual parameters) can have more than one type. Polymorphic types may be defined as types whose operations are applicable to operands of more than one type.

    大概含义就是 多态与单态形成对比,传统类型的语言的函数和过程及其操作数具有唯一的类型,而多态是函数其操作数(实际参数)可以具有多种类型。

到此为止,对面向对象编程的溯源就结束了,在这个过程中,我们了解了其历史,并且重新的认识了面向对象的三大特性。(由于英语比较渣,有些地方可能翻译的不对 欢迎与我反馈)

打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • © 2019-2021 musi

请我喝杯咖啡吧~

支付宝
微信