Infoq 听力笔记 : the state of oop

http://www.infoq.com/interviews/johnson-armstrong-oop

 

Infoq :现在的编程语言是否返祖,比如现在并发中流行的message passing(smalltalk早就使用),这是否意味着我们之前的道路都是错的.

 

Ralph Johnson: 喋喋不休,其主要观点是:新的东西出现时(包括好的东西),总是被人认为激进,然后慢慢的被大众所接受,而且是take one piece of it. 很早以前人们拒绝smalltalk,因为它有垃圾回收机制,现在没人反对。每种语言都是根据自己的目标策略走自己的路,比如c++要和c兼容,导致其复杂性的增加。

 

关于smalltalk的不足之处,是debugger on debugger on application(使用新的debugger调试旧的debugger),是一种适合小规模group开发小规模系统 in high speed.


Joe Armstrong: 有点像黄老邪,观点独到犀利。oo的三个基本元素是:隔离,消息,多态 

But you don't really do that and you don't really have isolation which is one of the problems. Dan Ingalls said yesterday (I thought it was very nice) about messaging that once you got messaging, you don't have to care where the message came from. You don't really have to care, the runtime system has to organize the delivery of the message, we don't have to care about how it's processed. It sort of decouples the sender and the receiver in this kind of mutual way. That's why I love messaging.

The 3 things that object oriented programming has it's messaging, which is possibly the most important thing. The next thing is isolation and that's what I talked about earlier, that my program shouldn't crash your program, if the 2 things are isolated, then any mistakes I make in my program will not crash your program. This is certainly not true with Java. You cannot take 2 Java applications, bung them in the JVM and one of them still halts the machine and the other one will halt as well. You can crash somebody else's application, so they are not isolated.

The third thing you want is polymorphism. Polymorphism is especially regarding messaging, that's just there for the programmer's convenience. It's very nice to have for all objects or all processes or whatever you call them, to have a printMe method - "Go print yourself" and then they print themselves. That's because the programmers, if they all got different names, the programmer is never going to remember this, so it's a polymorphism. It just means "OK, all objects have a printMe method. All objects have a what's your size method or introspection method."

在http://www.infoq.com/interviews/johnson-armstrong-parallel 中Joe提了一个观点说:

你要想正确的思考,必须有正确的抽象,否则会使问题变得困难。使用拉丁字母,很难表达乘法运算;使用阿拉伯字母,则很容易教授算术运算。

We come from agent programming and Erlang became the pioneering language for that. It's finding it's way into other languages as well now. Don't think it's actually very difficult. If you don't have the right abstractions, you can make things artificially difficult. For example, if I was going to teach arithmetic and I only knew about Roman numerals, you might get the idea that multiplication is extremely difficult. Given the idea of Arabic numerals it becomes a lot easier. If we took Roman numerals, the Romans have no way to express zero.

It was just a sort of concept that didn't exist so a whole branch of mathematics was not only difficult, it was impossible. If we have the wrong abstractions, we can make things which are intrinsically rather simple very difficult. I think that's what's happened in parallel programming. We're using the wrong abstractions and that's making things artificially difficult. 

That's why possibly patterns have come in, as a way to get around this. Given that we have the wrong abstractions, how do we use them in a way that we can nevertheless do things. By changing the way you view the world it's becomes less difficult.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

FireCoder

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值