阅读了一些关于 OOP 语言 smalltalk 的资料
发现 OOP 对于 java 来说,仅仅是一个 a.b()的 notation 和把数据和函数定义在一起的 class 而已,所谓的 everything is an object 没有任何意义,完全是句空话。
这就好像是说 java 其实是一门 FP 语言,因为它支持 higher order functions
object 在 smalltalk 里是非常灵活、高度可交互的
The basic idea of “object” is to invest a “full virtual computer” so it can provide useful services via messages in a machine independent way and with enough encapsulation to be safe against attack.
This also means that everything can and should be an object because (a) a full virtual computer can simulate any other kind of thing, and (b) because this also allows objects to be self-defining, self-documenting, etc.
对了作为高度可互动性的一部分,smalltalk 自然也支持 First-class functions
这帮奉承又不是不能用哲学的、源自机械的死板的汇编的 C 语言的后代真是摧毁了一切富有生机的奇思妙想,而且还到头来还喜欢装模做样的用这些思想的闪光点装点自己的门面
更装模做样的是明明就抄了个皮毛,反倒还规定起了 oop 的三大特性,什么封装继承多态,幽默
还有更典的是那个 receiver ,如果只学过 C like 的所谓 oop 语言,很难理解为什么 a.b()里的 a 叫 receiver 。而在 smalltalk 里这叫向 a 发送一条 b 消息,a 自然就是消息的 receiver
发现 OOP 对于 java 来说,仅仅是一个 a.b()的 notation 和把数据和函数定义在一起的 class 而已,所谓的 everything is an object 没有任何意义,完全是句空话。
这就好像是说 java 其实是一门 FP 语言,因为它支持 higher order functions
object 在 smalltalk 里是非常灵活、高度可交互的
The basic idea of “object” is to invest a “full virtual computer” so it can provide useful services via messages in a machine independent way and with enough encapsulation to be safe against attack.
This also means that everything can and should be an object because (a) a full virtual computer can simulate any other kind of thing, and (b) because this also allows objects to be self-defining, self-documenting, etc.
对了作为高度可互动性的一部分,smalltalk 自然也支持 First-class functions
这帮奉承又不是不能用哲学的、源自机械的死板的汇编的 C 语言的后代真是摧毁了一切富有生机的奇思妙想,而且还到头来还喜欢装模做样的用这些思想的闪光点装点自己的门面
更装模做样的是明明就抄了个皮毛,反倒还规定起了 oop 的三大特性,什么封装继承多态,幽默
还有更典的是那个 receiver ,如果只学过 C like 的所谓 oop 语言,很难理解为什么 a.b()里的 a 叫 receiver 。而在 smalltalk 里这叫向 a 发送一条 b 消息,a 自然就是消息的 receiver

