分享
 
 
 

J2EE vs. NET, Java vs. C#:比较公正的评价

王朝c#·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

J2EE vs. NET, Java vs. C#:

Since there's been plenty of discussion on these topics, I thought I'd write down my own views on these matters. For the record, just in case someone questions my experience in languages and libraries, I was one of the first adopters of Smalltalk, C++, and Java, taught all three professionally for several years, taught programming languages at UT Dallas, wrote an ORB in Smalltalk, wrote the first portable STL toolkit for C++, wrote the ObjectSpace Systems<ToolKit> cross-platform systems libraries, wrote the JGL generic collections library and the multi-protocol ObjectSpace Voyager Java ORB. And of course, I wrote a good deal of the TME Electric XML toolkit and GLUE web services platform for Java. Sorry for the long-winded introduction, but establishing a strong background in these areas helps to establish a basis for my opinions, and throws out any claims that I am some kind of Java-hater!

Historically, languages build on each other, borrowing the best ideas and then throwing in some new ones. Some languages evolve, some stagnate, and some die. C -> C++ -> C# is a good example of an evolution, and Smalltalk is an example of a language that I loved but is pretty much dead.

C# was designed by Anders Hejlsberg, a long-time hero of mine, the force behind Turbo Pascal and Delphi, and a guy with an obvious talent for language design and implemention. In C#, he's taken a lot of the best ideas from previous languages, integrated some new ones of his own, and come up with a natural evolution of where Java was heading. For example, the ability to associate attributes with any element supports declarative programming in an elegant and powerful way. C# makes iteration simpler and more natural for developers, and auto-boxing simplifies manipulating collections of primitives. There are many other nice features of C# that are covered in several articles I've read.

It's also significant to note that several new C# features have already been proposed and will be implemented soon, making C# one of the freshest and quickly evolving languages on the market.

The Java language, on the other hand, had a strong initial start and then essentially stagnated after Java 1.1. The only new thing in the last 6 years has been the assert keyword, which is not much to write home about. I'm definitely don't like languages that include an entire kitchen sink of features, but C# shows the kinds of features that could easily have been added to Java.

For a while, Sun was sitting in the cat bird's seat with a great lead in the languages and libraries space. Microsoft didn't want to adopt a strategic language that it could not improve upon, so it decided to create its own language that could be evolved at a reasonable pace. Now that C# has gone beyond Java, Sun has got to quickly evolve Java or watch it slowly fade away. I think that IBM realizes this, and I hope that it's working hard behind the scenes to rectify the situation.

It's frustrating but understandable that James Gosling holds disdain for C#. Gosling keeps going on about how C# is a clone of Java, but it's not - it borrows the best from Java and then adds improvements of its own, just like Java improved upon previous languages. That's the way it works, regardless of which company is involved!

Another thing about C# that seems misunderstood by much of the Java community is the concept of "unsafe" code. The idea behind "unsafe" code is that a programmer should be able to access low-level programming constructs without having to clumsily drop into a different language. In Java, you have to use JNI to link with libraries written in a language like C to get at low-level constructs. In C#, you can use the C# language to get at low-level constructs, and code which does this is marked specially so that the executing environment is aware of it and can prevent code flagged in this way from executing. This seems an elegant way of providing the full range of expressive power within a single language, less error prone, and easier to manage.

All that being said, I write my code in Java these days because of its portability.

Enough of Java and C#. What about J2EE and .NET?

The great thing about Java when it arrived was its simplicity and portability. Over time, the J2EE libraries have become pretty complex IMHO. For example, there have been many conversations on various news groups complaining about the learning curve and performance associated with EJB. .NET is definitely simpler than EJB for building server-side components, and so Java badly needs a new and simpler way to build portable and scalable server-side components. This of course is the reason that TME launched GLUE and has been working on its rapid evolution.

The main advantage that J2EE has over .NET is portability. Whether this advantage remains is primarily a business decision for Microsoft. There is no technical reason why the core .NET framework can't be made cross-platform, and several groups are already working on doing this. Heck, CLR was designed from the ground-up to support this! So J2EE is an uneasy situation in which a simple snap of Bill Gate's fingers results in its primarily advantage being neutralized.

The best defense for Java/J2EE is fairly straightforward:

- standarize Java and allow some of the language wizards at IBM and other companies to evolve the language at a similar pace to C#.

- come up with a far simpler server-side programming alternative to EJB

Time is running out......

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有