Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » 灌水乐园  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 到底有多少程序员真正会抽象?
cxp108





发贴: 363
于 2009-02-01 10:44 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
抽象是面对对象的基础,尽管面对对象不是一切但我觉得这总应
该是个入门吧?我怎么老觉得身边的程序员只有极少极少数会抽象?
而且好像和从业时间没有关系....
在没有对逻辑进行抽象的情况下,哪些工具到底还有多大意义?
真搞不懂,有些人整天讲着Spring,可是只要程序需要变动一下
,还是闷着头加个接口加个类,然后把它们放入Spring的配置文
件中,或者对现有程序大改特改后重新编译项目。我真不明白这样
到底是他用Spring还是Spring用他??



作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
Biubiu

Pure Java

总版主


发贴: 471
于 2009-02-02 09:38 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
电脑的要求比人的要求低多了。所以大多数人做的事情是让电脑happy。真正会抽象的人是把编程作为艺术在做的人,即时科学家又是艺术家,少之又少。


In theory, there is no difference between theory and practice; in practice, however, there is.

If the only tool you have is a hammer, you tend to see every problem as a nail.
作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
menzy



版主


发贴: 754
于 2009-02-03 08:11 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
现在缺少的还是有创作能力的人
浅尝辄止,国人肤浅



作者 Re:到底有多少程序员真正会抽象? [Re:Biubiu]
cxp108





发贴: 363
于 2009-02-03 10:24 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Biubiu wrote:
电脑的要求比人的要求低多了。所以大多数人做的事情是让电脑happy。真正会抽象的人是把编程作为艺术在做的人,即时科学家又是艺术家,少之又少。

其实也不一定要到“艺术”的这种程度,但我觉得抽象是很基本的代码重用技巧。
可是我从业至今真的很少看到有这种能力的程序员。很多程序员都是只懂得一种
程序结构...不管在那个程序里都是DAO,service,action等等...而对真正需要抽象
的业务逻辑,却完全不与理睬,对于一个新的需求,就是进行新的编码,而不是考虑
如何更好的重用现有代码。



作者 Re:到底有多少程序员真正会抽象? [Re:menzy]
cxp108





发贴: 363
于 2009-02-03 10:28 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
menzy wrote:
现在缺少的还是有创作能力的人
浅尝辄止,国人肤浅

我觉得有些人根本连浅尝都不会,纯粹跟风!别人说Spring好用,他就立刻
在自己项目里加了Spring,别人又说Hibernate好用,他就赶紧下了Hibernate
放入自己的项目中。
他只要求项目“有用到”Spring hibernate就可以,其余的只要程序目前能运
行就好,别的不管。



作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
wes109

以梦为马

CJSDN高级会员


发贴: 857
于 2009-02-03 10:38 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
牢骚贴,鉴定完毕!



作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
Biubiu

Pure Java

总版主


发贴: 471
于 2009-02-03 11:26 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
cxp108 wrote:
其实也不一定要到“艺术”的这种程度,但我觉得抽象是很基本的代码重用技巧。
可是我从业至今真的很少看到有这种能力的程序员。很多程序员都是只懂得一种
程序结构...不管在那个程序里都是DAO,service,action等等...而对真正需要抽象
的业务逻辑,却完全不与理睬,对于一个新的需求,就是进行新的编码,而不是考虑
如何更好的重用现有代码。


经过几次折腾才会知道啥叫重用。很多从业人员都是跟风性质的,所以领头羊很重要。Spring、Hibernate都是应该框架,大多数人把业务逻辑散落在这些应用框架中。殊不知应用是“壳”,业务是”核“。



In theory, there is no difference between theory and practice; in practice, however, there is.

If the only tool you have is a hammer, you tend to see every problem as a nail.
作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
gaoxt1983





发贴: 67
于 2009-02-03 19:18 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我们老板就是这样……在各个网站上搜索ruby和rails的gem和plugin,看到别人说好就用,有时候连没完成得也用


作者 Re:到底有多少程序员真正会抽象? [Re:Biubiu]
cxp108





发贴: 363
于 2009-02-04 17:46 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Biubiu wrote:
殊不知应用是“壳”,业务是”核“。

非常同意!
业务逻辑的抽象基于对业务的了解,更重要的是对业务的思考。
一个能够很好地抽象业务逻辑的开发人员,对于他负责的部分
甚至整个系统未来可能的变化已经了然于胸了,因此他敢于接受
挑战,而那种只懂得闷头写代码的人,面对变化只能越来越迷糊
,代码就越写越找不到北。



作者 Re:到底有多少程序员真正会抽象? [Re:wes109]
cxp108





发贴: 363
于 2009-02-04 17:50 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
wes109 wrote:
牢骚贴,鉴定完毕!

是啊,这其实真的是个老调重弹...只是我觉得没有掌握这个基础
技术应该是个别现象,可怎么现实中却是个普遍现象....



作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
JiafanZhou



版主


发贴: 736
于 2009-02-04 20:44 user profilesend a private message to usersend email to JiafanZhousearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
See this great, old (and long) blog entry about this:

http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html

"Dude, not everything is an object."
不是每个东西都是对象。



When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
作者 Re:到底有多少程序员真正会抽象? [Re:JiafanZhou]
cxp108





发贴: 363
于 2009-02-05 09:23 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
好长...有空会仔细看看的。
在软件开发的更深层次来讲,面对对象也许不是最好的,
但是现在大部分的软件开发入门书都是以“面对对象”作为
软件设计的启蒙的。我想我们大部分人都是被这样教导的。



作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
JiafanZhou



版主


发贴: 736
于 2009-02-06 18:28 user profilesend a private message to usersend email to JiafanZhousearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
I believe that Java has its own cons and pros.


When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
jigsaw

KK

CJSDN高级会员


发贴: 3666
于 2009-02-08 03:21 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
面向对象的精髓在于函数指针。。。
最最经典的例子是c bible的qsort实现



No one knows except both of us.
909090909090909090909090909090909090909090b8533ce76c8d6c241868968a0408c338b4ffbf
ISO/IEC 9899:1999
作者 Re:到底有多少程序员真正会抽象? [Re:Biubiu]
烂泥





发贴: 538
于 2009-02-08 20:05 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Biubiu wrote:
经过几次折腾才会知道啥叫重用。很多从业人员都是跟风性质的,所以领头羊很重要。Spring、Hibernate都是应该框架,大多数人把业务逻辑散落在这些应用框架中。殊不知应用是“壳”,业务是”核“。


这句话算是精辟了,看来是老同志的肺腑之言了.



作者 Re:到底有多少程序员真正会抽象? [Re:JiafanZhou]
Biubiu

Pure Java

总版主


发贴: 471
于 2009-02-09 15:15 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
JiafanZhou wrote:
I believe that Java has its own cons and pros.


Which programming language doesn't? Why not try Scala?



In theory, there is no difference between theory and practice; in practice, however, there is.

If the only tool you have is a hammer, you tend to see every problem as a nail.
作者 Re:到底有多少程序员真正会抽象? [Re:JiafanZhou]
cxp108





发贴: 363
于 2009-02-11 11:36 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
JiafanZhou wrote:
I believe that Java has its own cons and pros.

任何事物都有...何况一门计算机语言....
java具有众多高级语言的优点当然也继承了缺点,不过实践也证明
它是人类驾驭计算机来完成任务的好帮手。



作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
sinlang





发贴: 5
于 2009-02-11 14:00 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
好像重来不用呢x


作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
JiafanZhou



版主


发贴: 736
于 2009-02-11 23:05 user profilesend a private message to usersend email to JiafanZhousearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
cxp108 wrote:
java具有众多高级语言的优点当然也继承了缺点,不过实践也证明
它是人类驾驭计算机来完成任务的好帮手。


The viewpoint I want to make here is that Java does have its distinct <b>disadvantages</b> in various aspects. However, I do believe that lots of things have been introduced into the Java programming language to make it more procedural-oriented.

Object oriented design and programming was initially designed to target the object in the real world. Unfortunately, sometimes programming language is a more relatively low level task, which is much closer to the computer.

Here, I want to introduce some examples:

1. Create Thread and manipulate it is too complicated.

The following shell scripting code example will take all the files in the directory called jiafanz and run each in the background. This is not a very good example, but do (re-)implement this feature in Java, count the number of lines of code and compare.


for f in jiafanz/*; do
"$f" &
done


Thereafter, you will pull your hair off and wonder why it is so complex to create threads in Java!!!

2. AOP is not an implicit gadget of Java which can greatly simplify things.
Consider the following example:


handleException()
{
...
}

method1()
{
try
{

}
catch (Exception ex)
{
handleException()
}
}

method2()...

method3()...

methodX()...


This code seems ok if there is only one or a few methods that needs to handle the exception. But what happened if we have hundreds of the methods which need to catch the exception??? It is stupid to duplicate the same try and catch block in every single method. Basically it is a stupid thing to do.

If this example reminds you that the database exception, then you are right. The Spring framework and hibernate framework detects this pitfall in Java, and thus greatly simplify it using AOP or reflection or other techniques.

3. Annotation is basically makes Java into a runtime language like shell scripting. So why Java again???

Sometimes I feel that implementing functional feature (like thread features or other lower level features) is verbose and awkward.

I'm sure that you have other similar examples.

Jiafan



When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
floater

Java Jedi

总版主


发贴: 3233
于 2009-02-13 00:49 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
My 2 cents.

Example 1: You can make a smaill class to seal the details so that you code is similar to shell scripts, I suspect there are already code on the internet to do this.

Example 2: If there are hundreds of methods that need this, the AOP is really arguable. Because if there are hundreds of methods, then the code base is pretty large, likely to be maintained by several different teams, with AOP weaving, it's hard to track the code, think about debugging. I am having this problem now, scratch my hair and have no clue. Somewhere somehow one of the places the code doesn't catch the exception(forgot to weave), it bombs out everyday, don't know where, don't know how. There are 21 million of calculations and only a dozen errors, very hard to find where it happened. Damn it.

Example 3: using reflection we can make java more like scripting, but it's hard to track down where what is used. Strong typing makes tracking a lot easier. So depending on where we use the language, it's hard to compare java/c++ with scripting languages. It's more like a balanced choice.

I hate java too, it can't even get the number classes right, among others. But we get paid, right?

If you can identify some defficiency in java and you can fix it with a library, that's a good chance for you to make a fame. But not all trials are successful.

There is a good strategic game, making the history gold edition. Play chinese, Smile.



"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler, Refactoring - Improving the Design of Existing Code
作者 Re:到底有多少程序员真正会抽象? [Re:cxp108]
cxp108





发贴: 363
于 2009-02-13 16:14 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
啊....floater回来了!
你说的查错困难是AOP的天生劣势吗?还是在使用AOP过程中人为把握不好的
问题?



作者 Re:到底有多少程序员真正会抽象? [Re:floater]
JiafanZhou



版主


发贴: 736
于 2009-02-18 18:55 user profilesend a private message to usersend email to JiafanZhousearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
floater wrote:
Example 1: You can make a smaill class to seal the details so that you code is similar to shell scripts, I suspect there are already code on the internet to do this.

It is possibly true. I don't doubt that there are plenty of talented Java programmers out there to do this task. But my viewpoint is Java is not a good language to handle threads in an easy manner. Compared with other scripting language like bash shell, it is totally a nightmare to deal with process/thread in Java. Plus to make it work, we need to install JRE, download JDK, write couple of classes, deploy into a jar possibly, then it should be good to go. Whereas using shell scripting, we can achieve them in 3 simple lines on the fly. Don't take this in the wrong way, I criticise Java in this part because I want Java to be better.

floater wrote:
Example 2: If there are hundreds of methods that need this, the AOP is really arguable. Because if there are hundreds of methods, then the code base is pretty large, likely to be maintained by several different teams, with AOP weaving, it's hard to track the code, think about debugging. I am having this problem now, scratch my hair and have no clue. Somewhere somehow one of the places the code doesn't catch the exception(forgot to weave), it bombs out everyday, don't know where, don't know how. There are 21 million of calculations and only a dozen errors, very hard to find where it happened. Damn it.

I can't agree more on this. A poorly implemented AOP is another thorn for programmers. I believe if AOP is implemented in a more comprehensive way, (or maybe more comments will help us to understand the flow). And to improve the usability of AOP, it is used quite often in the Spring Framework and Hibernate Framework. And it is really a big success.

floater wrote:
Example 3: using reflection we can make java more like scripting, but it's hard to track down where what is used. Strong typing makes tracking a lot easier. So depending on where we use the language, it's hard to compare java/c++ with scripting languages. It's more like a balanced choice.

Yes, again, reflection in Java is a powerful tool which is another double-edged sword. Use the reflection wrong could seriously affect the performance and could be considered as anti-pattern. (this statement is not completely true). Let me introduce the following link:
http://www.odi.ch/prog/design/newbies.php#24

And I believe that we all go too tangent on this thread, in which indicates how many programmers understand abstract. Well, abstract is one of the three object-oriented programming features, and it belongs to the general OOL. If it is a deficiency, then it would apply to all the OOL. Smile We should blame the general concept of the OO. (Dude, not everything in computer is an object)

My 2 cents,
Jiafan



When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
作者 Re:到底有多少程序员真正会抽象? [Re:wes109]
robin

超级水鬼



发贴: 128
于 2009-02-27 16:54 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
wes109 wrote:
牢骚贴,鉴定完毕!

同意!



作者 Re:到底有多少程序员真正会抽象? [Re:robin]
cxp108





发贴: 363
于 2009-03-02 09:40 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
robin wrote:
同意!

明显来灌水的....




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923