Topic: 到底有多少程序员真正会抽象?

  Print this page

1.到底有多少程序员真正会抽象? Copy to clipboard
Posted by: cxp108
Posted on: 2009-02-01 10:44

抽象是面对对象的基础,尽管面对对象不是一切但我觉得这总应
该是个入门吧?我怎么老觉得身边的程序员只有极少极少数会抽象?
而且好像和从业时间没有关系....
在没有对逻辑进行抽象的情况下,哪些工具到底还有多大意义?
真搞不懂,有些人整天讲着Spring,可是只要程序需要变动一下
,还是闷着头加个接口加个类,然后把它们放入Spring的配置文
件中,或者对现有程序大改特改后重新编译项目。我真不明白这样
到底是他用Spring还是Spring用他??

2.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: Biubiu
Posted on: 2009-02-02 09:38

电脑的要求比人的要求低多了。所以大多数人做的事情是让电脑happy。真正会抽象的人是把编程作为艺术在做的人,即时科学家又是艺术家,少之又少。

3.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: menzy
Posted on: 2009-02-03 08:11

现在缺少的还是有创作能力的人
浅尝辄止,国人肤浅

4.Re:到底有多少程序员真正会抽象? [Re: Biubiu] Copy to clipboard
Posted by: cxp108
Posted on: 2009-02-03 10:24

Biubiu wrote:
电脑的要求比人的要求低多了。所以大多数人做的事情是让电脑happy。真正会抽象的人是把编程作为艺术在做的人,即时科学家又是艺术家,少之又少。

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

5.Re:到底有多少程序员真正会抽象? [Re: menzy] Copy to clipboard
Posted by: cxp108
Posted on: 2009-02-03 10:28

menzy wrote:
现在缺少的还是有创作能力的人
浅尝辄止,国人肤浅

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

6.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: wes109
Posted on: 2009-02-03 10:38

牢骚贴,鉴定完毕!

7.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: Biubiu
Posted on: 2009-02-03 11:26

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


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

8.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: gaoxt1983
Posted on: 2009-02-03 19:18

我们老板就是这样……在各个网站上搜索ruby和rails的gem和plugin,看到别人说好就用,有时候连没完成得也用

9.Re:到底有多少程序员真正会抽象? [Re: Biubiu] Copy to clipboard
Posted by: cxp108
Posted on: 2009-02-04 17:46

Biubiu wrote:
殊不知应用是“壳”,业务是”核“。

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

10.Re:到底有多少程序员真正会抽象? [Re: wes109] Copy to clipboard
Posted by: cxp108
Posted on: 2009-02-04 17:50

wes109 wrote:
牢骚贴,鉴定完毕!

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

11.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: JiafanZhou
Posted on: 2009-02-04 20:44

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."
不是每个东西都是对象。

12.Re:到底有多少程序员真正会抽象? [Re: JiafanZhou] Copy to clipboard
Posted by: cxp108
Posted on: 2009-02-05 09:23

好长...有空会仔细看看的。
在软件开发的更深层次来讲,面对对象也许不是最好的,
但是现在大部分的软件开发入门书都是以“面对对象”作为
软件设计的启蒙的。我想我们大部分人都是被这样教导的。

13.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: JiafanZhou
Posted on: 2009-02-06 18:28

I believe that Java has its own cons and pros.

14.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: jigsaw
Posted on: 2009-02-08 03:21

面向对象的精髓在于函数指针。。。
最最经典的例子是c bible的qsort实现

15.Re:到底有多少程序员真正会抽象? [Re: Biubiu] Copy to clipboard
Posted by: 烂泥
Posted on: 2009-02-08 20:05

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


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

16.Re:到底有多少程序员真正会抽象? [Re: JiafanZhou] Copy to clipboard
Posted by: Biubiu
Posted on: 2009-02-09 15:15

JiafanZhou wrote:
I believe that Java has its own cons and pros.


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

17.Re:到底有多少程序员真正会抽象? [Re: JiafanZhou] Copy to clipboard
Posted by: cxp108
Posted on: 2009-02-11 11:36

JiafanZhou wrote:
I believe that Java has its own cons and pros.

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

18.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: sinlang
Posted on: 2009-02-11 14:00

好像重来不用呢x

19.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: JiafanZhou
Posted on: 2009-02-11 23:05

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

20.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: floater
Posted on: 2009-02-13 00:49

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.

21.Re:到底有多少程序员真正会抽象? [Re: cxp108] Copy to clipboard
Posted by: cxp108
Posted on: 2009-02-13 16:14

啊....floater回来了!
你说的查错困难是AOP的天生劣势吗?还是在使用AOP过程中人为把握不好的
问题?

22.Re:到底有多少程序员真正会抽象? [Re: floater] Copy to clipboard
Posted by: JiafanZhou
Posted on: 2009-02-18 18:55

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

23.Re:到底有多少程序员真正会抽象? [Re: wes109] Copy to clipboard
Posted by: robin
Posted on: 2009-02-27 16:54

wes109 wrote:
牢骚贴,鉴定完毕!

同意!

24.Re:到底有多少程序员真正会抽象? [Re: robin] Copy to clipboard
Posted by: cxp108
Posted on: 2009-03-02 09:40

robin wrote:
同意!

明显来灌水的....


   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