i*****o 发帖数: 1714 | 1 有关java的观察,写的很好玩,值得浪费时间读。
http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of
java把object-oriented推向了一个极端,觉得现在风向有从object-oriented向
functional转的趋势。 | a*w 发帖数: 4495 | 2 这人根本不理解OOP。
【在 i*****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 有关java的观察,写的很好玩,值得浪费时间读。 : http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of : java把object-oriented推向了一个极端,觉得现在风向有从object-oriented向 : functional转的趋势。
| g*****g 发帖数: 34805 | 3 Java is like a swiss army knife that has a very handy knife. If you
want to use it as a scissor, it has a scissor too. But it's not
better than your plain old scissor.
【在 i*****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 有关java的观察,写的很好玩,值得浪费时间读。 : http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of : java把object-oriented推向了一个极端,觉得现在风向有从object-oriented向 : functional转的趋势。
| i*****o 发帖数: 1714 | 4 In the blogger's view, the verb "cut" has to be a slave of an "noun" master,
in this case it could be either a knife or scissor. So if you want to cut
something, you'd have to create a class called knife, or a scissor, or maybe
a classes hierarchy like tools->knife etc, which is overly complicated for
such a simple action. While there may be reasons for such implementation,
his point was that the language itself should not impose such harsh
restriction.
But there are always other choices. It's fun to see one side make fun of
the other side, and there is always truth to be learned from these arguments.
★ 发自iPhone App: ChineseWeb - 中文网站浏览器
【在 g*****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Java is like a swiss army knife that has a very handy knife. If you : want to use it as a scissor, it has a scissor too. But it's not : better than your plain old scissor.
| g*****g 发帖数: 34805 | 5 Well, if you think the other way. How knife does cut is different from
how scissor does cut. And that's why you want to define an interface
with cut verb and have knife and scissor maintain the details individually.
A person without any knowledge of knife and scissor then can press
the cut button on knife/scissor and be done with it. Now you realize
you need a feedStuff verb too, and later a clean verb. In no time
you realize you have too many verbs to handle and it's a good idea
to organize them around nouns.
It's over-complicated if there's only one way to do cut, but the real
world is more closer to OO than not.
master,
maybe
for
arguments.
【在 i*****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : In the blogger's view, the verb "cut" has to be a slave of an "noun" master, : in this case it could be either a knife or scissor. So if you want to cut : something, you'd have to create a class called knife, or a scissor, or maybe : a classes hierarchy like tools->knife etc, which is overly complicated for : such a simple action. While there may be reasons for such implementation, : his point was that the language itself should not impose such harsh : restriction. : But there are always other choices. It's fun to see one side make fun of : the other side, and there is always truth to be learned from these arguments. :
|
|