[译]Java vs .NET

类别:Java 点击:0 评论:0 推荐:

在此我们要考虑两个因素:Java有着广泛的、热情的支持者,他们已经投入了足够的时间来熟练地掌握这门语言。他们可以随心所欲地使用这门语言——至少在服务器端编程和桌面应用编程是如此的。并且Java是跨平台的,随着Linux越来越流行,加之苹果公司已经转向了OSX(而现在,正如它所展露的那样,OSX极好地支持了Java),这点显得愈加重要了。

第二个要考虑到的,是Microsoft仍一如既往地统治着桌面。虽然很多曾经推崇Microsoft人现在已经不再对Microsoft顶礼膜拜,但是他们依然在用Microsoft的产品(指Windows,涕淌注)。如果你打算开发一款能够火卖的产品,那么你一定至少要为使你的产品能够运行于Windows而进行疯狂的努力。是的,Java确实能够在Windows下运行,但是它那诡异的界面可能会把一些用户吓跑的。

你可千万不可以小觑C#(当我第一次看到它时,我的反应却正是如此,多半归咎于Microsoft过去在实现C++标准时那恶劣手法给我留下的烙印)。C#是Microsoft在编程语言竞技场上最佳的武器——不但构思天衣无缝,设计也同样巧夺天工。严格地从商业战略的立场出发,我不得不说,如果我正在为我的公司开发一款企业招牌产品,我会很慎重地考虑使用C#的(至少在理论上说,Microsoft下一代的Windows一定会捆绑.NET运行库,而且发布它的时间距离我们真是越来越近了)。

毫无疑问,C#才是Java现今面临到的真正敌手,而且Sun已经开始做出回击了。在JDK 1.5中,我们将清楚地看到那些直接取材于C#的特性。在Java 1的时代,他们就宣称Java拥有某种新的桌面开发系统,可以使得GUI桌面应用的开发会比VB还要容易。就这步回击而言,我可以说C#对Java的影响是有利无害的。另外,IBM的Eclipse开发环境将成为Visual Studio的极具竞争力的替代品,并且他们的SWT也提供了比Swing更为亲切友好的界面,所以你完全能够开发出一个界面不让用户感到陌生的软件。

我在这里所说的,只是想告诉你们,在短期内两家是不会分出胜负来的。他们之间将会发生一场决斗(抑或是一场战争),但是这个过程却是用最褒义的辞藻来描绘的:两家公司将争相地采取措施来吸引程序员,这意味着你的职业生活将越来越容易了。最好的结果,是两种语言/平台将始终投入在这场游戏中,并且决斗还要一直僵持下去。你可能要怀疑Java/Sun打败Microsoft的能力,但是别忘了:IBM每年在Java上投入的资金大约是Sun投入的10倍。即使Sun没有能提出一个新的、有远见的商业计划(参见Robert Cringely对此的评论)而败在了下风,IBM也会抢过掌管Java巨舰的舵。所以,这对我们都有益,因为这场决斗势必要继续下去,而且我相信最终你也会选择出一个符合你自己口味的语言的。

                                                                2004年11月5日
                                                                涕淌译于小百合工作室


@以下是原文供读者参考@
There are two factors here: Java has a large, passionate following of people who have spent enough time with the language to know it well. It has generally served them well -- at least for server-side programming and for some desktop application programming. And Java is cross-platform, something which continues to grow in importance as Linux becomes more popular and since Apple has gone to OSX (and now, finally, supports Java -- quite well, as it turns out).

The second factor is that Microsoft still dominates the desktop. Lots of people who used to adore Microsoft now don't, but they still use it. If you were trying to create a product that you wanted to sell a lot of, you'd be crazy not to at least make it work under Windows. Yes, Java will work under Windows, but it looks different enough that it might scare some people off.

And C# is nothing to sneeze at (precisely what I did when I first saw it, primarily based on Microsoft's past performance implementing the C++ standard, which was nothing short of abominable). C# is the best thing Microsoft has done in the language arena -- very well thought-out and architected. I'd have to say, strictly from a business standpoint, if I were creating a product that I was basing the company on, I would seriously consider writing it in C# (at least, when the next MS Windows looks more imminent, since in theory it will have the .NET runtime built in).

There's no question that C# is the first real competition Java has seen, and already Sun has started to respond to this. JDK 1.5 will have features that are clearly inspired directly from C#. At Java One they announced some kind of new desktop development system where they want to make the creation of GUI desktop apps easier than VB. Based on this response, I can say that C# will do nothing but good for Java. In addition, IBM's Eclipse development environment provides a competetive alternative for Visual Studio and their SWT provides a more native GUI look-and-feel than does Swing, so you have the option to create something that won't look so unfamiliar to users.

All that I've said here just indicates that there will be no clear winner right away. There's going to be a battle (or a war), but in the best sense of the word: both companies will be fighting to do things to attract programmers, and that means trying to make your life as easy as possible. The best possible outcome will be that both languages/platforms stay in the game and that this battle continues. You may wonder how Java/Sun can win against Microsoft, but keep this in mind: IBM puts roughly 10 times the money into Java per year that Sun does. Even if Sun can't come up with a new, insightful business plan (see Robert Cringely's discussion of this) and goes under, IBM will take the helm and continue to support and promote Java. So the battle will continue, to our benefit, and in the end I think you'll be able to choose the language you want depending on what you need.

本文地址:http://com.8s8s.com/it/it13847.htm