Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Tue, 22 Jul 2003
So now loose coupling is good...
Don Box's posting on delegates is a little funny. He basically shows how delegates can be used to reduce the coupling between two pieces of code, because one end no longer has to be aware of the interface being exported by the other end. This is equivalent to removing some type information from the program. So if removing some type information is good because it reduces coupling, then why not remove all type information?
[02:01] |
[computers/programming] |
# |
TB |
F |
G |
10 Comments |
![Other blogs commenting on this post](/py-bin/images/bubble.gif)
Everyone touches a different part of the elephant. Over at Lambda the Ultimate, they viewed that post as an OO type stumbling toward the joys of higher order programming.
Could it be that support for multiple programming paradigms is a good thing? :)
Posted by Wilhelm at Tue Jul 22 08:45:54 2003
Could it be that support for multiple programming paradigms is a good thing? :)
Posted by Wilhelm at Tue Jul 22 08:45:54 2003
Hmmm... the URL for [LtU http://lambda.weblogs.com/discuss/msgReader$7874] got mangled, trying again.
Posted by Wilhelm at Tue Jul 22 08:49:16 2003
Posted by Wilhelm at Tue Jul 22 08:49:16 2003
Bother. If anybody really cares, there should be a dollars sign, plus the number 7874 at the end of those URLs.
Posted by Wilhelm at Tue Jul 22 08:50:22 2003
Posted by Wilhelm at Tue Jul 22 08:50:22 2003
Ted Leung points out that Don Box is advocating a loosely coupled (dynamically typed) approach with delegates. So, as Ted asked - if getting rid of type information in a delegate situation is a good thing, what value are the type declarations providing elsewhere? Meanwhile, Sun continues to simply not get it at all - Java 1.5 will be providing C style templates.
Posted by Trackback from Cincom Smalltalk Blog - Smalltalk with Rants at Tue Jul 22 09:13:13 2003
Posted by Trackback from Cincom Smalltalk Blog - Smalltalk with Rants at Tue Jul 22 09:13:13 2003
I'm not sure it really removes "type information" so much as just "naming" details.
In .NET delegates are still typed - in Don's example, you still have to provide a method that takes a single object paramater and returns a bool value. The only real change is that there is no restriction on the name of that method.
Posted by Jorgen Thelin at Tue Jul 22 10:32:41 2003
In .NET delegates are still typed - in Don's example, you still have to provide a method that takes a single object paramater and returns a bool value. The only real change is that there is no restriction on the name of that method.
Posted by Jorgen Thelin at Tue Jul 22 10:32:41 2003
Jorgen,
Yes, technically, the method name in the interface is a name and would not usually be considered part of the type. But it's still a static part of the contract between the two classes. The main point I was raising was about the requirement for static constraints of any type.
Posted by Ted Leung at Tue Jul 22 11:12:50 2003
Yes, technically, the method name in the interface is a name and would not usually be considered part of the type. But it's still a static part of the contract between the two classes. The main point I was raising was about the requirement for static constraints of any type.
Posted by Ted Leung at Tue Jul 22 11:12:50 2003
Provocative comment! But not right, I think. We're still communicating type information, just in a different way and without any unnecessary 'carrier'. See my weblog entry:
Posted by Roger Searjeant at Tue Jul 22 14:16:46 2003
Posted by Roger Searjeant at Tue Jul 22 14:16:46 2003
Roger,
In my mind this is just another reason to move on to languages where we don't have to write down all these constraints. The problem is that type systems are straight jackets, and now we're saying, oh, but I'd like the jacket to fit a little looser right down here. Maybe we don't actually need the straight jacket...
Posted by Ted Leung at Tue Jul 22 16:58:38 2003
In my mind this is just another reason to move on to languages where we don't have to write down all these constraints. The problem is that type systems are straight jackets, and now we're saying, oh, but I'd like the jacket to fit a little looser right down here. Maybe we don't actually need the straight jacket...
Posted by Ted Leung at Tue Jul 22 16:58:38 2003
"In my mind this is just another reason to move on to languages..."
Hmmm. I think a lot of people would say that one is not "moving on" per-se, but is rather taking a step backwards... Horses for courses mate.
Posted by Oisin Grehan at Wed Jul 23 01:51:09 2003
Hmmm. I think a lot of people would say that one is not "moving on" per-se, but is rather taking a step backwards... Horses for courses mate.
Posted by Oisin Grehan at Wed Jul 23 01:51:09 2003
Oisin,
See the "lisp" category on this blog. I totally agree, but most people think that this is a new thing.
Posted by Ted Leung at Wed Jul 23 01:54:40 2003
See the "lisp" category on this blog. I totally agree, but most people think that this is a new thing.
Posted by Ted Leung at Wed Jul 23 01:54:40 2003
You can subscribe to an RSS feed of the comments for this blog:
Add a comment here:
You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk
![RSS Feed for comments](http://www.sauria.com/py-bin/images/xml.gif)
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
<a href>
, <em>
, <i>
, <b>
, <blockquote>
, <br/>
, <p>
, <code>
, <pre>
, <cite>
, <sub>
and <sup>
.You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk