What Is Java:part 1(翻译练手)

原文如下:http://www.onjava.com/pub/a/onjava/2006/03/08/what-is-java.html?CMP=OTC-

FP2116136014&ATT=What+Is+Java

Java
"Java" generally refers to a combination of three things: the Java programming language (a high

-level, object-oriented programming language); the Java Virtual Machine (a high-performance

virtual machine that executes bytecodes on a specific computing platform, typically abbreviated

JVM); and the Java platform, a JVM running compiled Java bytecodes, usually calling on a set of

standard libraries such as those provided by Java Standard Edition (SE) or Enterprise Edition

(EE). Though coupled by design, the language does not imply the JVM, and vice versa.
"java" 一词一般指三种东西的混合体:第一:Java编程语言(一种高层次的面向对象编程语言);第二:

Java虚拟机(一种在特定平台上执行字节码的高性能的虚拟机,当然,该平台是武装了JVM的);还有Java平

台(下句怎么翻译)。虽然在设计"java"之初他们就是三位一体的,但是Java语言并不代表JVM,反之亦然。
In this Article
The Java Programming Language
The Java Platforms
The Java Virtual Machine
The JVM Without Java
The Java Community Process
Conclusions
We recently received an email asking for a "What Is Java" entry on the O'Reilly Network What Is

site. Who could possibly not know what Java is in 2006? After ten years of books, websites, and

conferences, doesn't everyone know what Java is? Apparently not.
这篇文章包括:
1.Java编程语言
2.Java平台
3.Java虚拟机
4.不包括Java(Java编程语言??)的JVM
5.Java委员会
6.结论
最近我们在O'Reilly网站的“what is”板块上受到了一封询问“什么是Java”的email.有谁有可能在2006年

还不知道Java呢?经过大量的书籍,网页和会议在Java诞生之后的十年时间里的宣传和介绍,难道不是每个人

都知道Java了吗?很显然,这封邮件告诉我们事实并非如此。
After all, things have changed.
For every dusty definition that speaks of applets and Just-In-Time compilers, there are new

directions and new realities that have settled in, understood by many, yet not always completely

documented. Java used to mean:
Applets
Bytecode interpretation
Slow performance
A "cargo cult" awaiting drops from Sun
Today, it means:
Web applications, web services, SOAs, etc.
Hotspot dynamic compilation
High-performance
An open source community, increasingly independent of Sun
The old slogan "Write Once, Run Anywhere" still holds true--but what's being written and where

and how it's being run are changing.
毕竟很多事情都已经改变了。
伴随着applets和及时编译器等古老的概念,又有很多全新的方向和事实产生,虽然很多人懂得这些新东西,

但是这些新东西不是每次都被完全的纪录。Java曾经和下列概念有着千丝万缕的关系:
Applets
字节码解释
低性能
一群Sun公司技术产品的信徒
今天,Java又包含着下列概念:
web应用,web services,soa等等;
hotspot动态编译。
高性能
一个逐渐独立于Sun公司的开源社区
“一次编写,随处运行”的“神话”依然不灭,不过关于编写什么和怎样运行却在不停的变化。
The Java Programming Language
一:Java编程语言
Java, the language, is a high-level object-oriented programming language, influenced in various

ways by C, C++, and Smalltalk, with ideas borrowed from other languages as well (see O'Reilly's

History of Programming Languages). Its syntax was designed to be familiar to those familiar with

C-descended "curly brace" languages, but with arguably stronger OO principles than those found

in C++, static typing of objects, and a fairly rigid system of exceptions that require every

method in the call stack to either handle exceptions or declare their ability to throw them.

Garbage collection is assumed, sparing the developer from having to free memory used by obsolete

objects.
Java,作为一种计算机语言,它是一种高级面向对象的编程语言。Java在很多方面都受c,c++和smalltalk语言

的影响,同时又吸取了很多别的编程语言的精华。由于设计之初的考虑使得熟悉c语言系的工程师也很熟悉

Java的语法。但是同时Java又有很明显的比c++更强的面向对象原则和一个相对更苛刻的异常处理系统。这同

系统要求每一个方法在调用栈中要么处理异常,要么申明自己抛出异常的能力。垃圾回收器被认为是结束了开

发者使用晦涩的对象去释放内存的噩梦。
One of Java's more controversial aspects--widely accepted at the time of its release but

increasingly criticized today--is its incomplete object-orientation. Specifically, Java

primitives such as int, char, boolean, etc. are not objects, and require a completely different

treatment from the developer: as int is not a class, you cannot subclass and declare new methods

on it, cannot pass it to a method that expects a generic Object, and so on. The inclusion of

primitives increases Java performance, but at the arguable expense of code clarity, as anyone

who's had to work with the so-called "wrapper classes" (Integer, Character, and Boolean) will

attest. Java 5.0 introduces an "autoboxing" scheme to eliminate many uses of the wrapper

classes, but in some ways it obscures what is really going on.
Java的一个主要贡献方面是它的非纯粹的面向对象特性。这一特性在Java发布之初被广泛接受,但是现在却越

来越多的受到非议。具体来说,Java的原始数据类型,如int型,char型,boolean型等都不是对象,所以他们

要求开发者以完全不同于处理对象的方法处理他们:应为int型不是一个class,所以你不能继承他并且定义新

的方法,也不能把int型的数据传给一个要求Object这种“万能类别”的方法,还有很多类似的不便之处。
包含原始数据类型可以提升Java的性能,但是代价是要多写一些代码--任何一个不得不使用所谓的包装类的人

就会明白这样的代价。Java 5.0引进了“自动装箱”这种策略去减少包装类的使用,但是有些时候这种策略会

让人混淆数据类型。
Philosophically, Java is a "fail early" language. Because of its syntactic restrictions, many

programming failures are simply not possible in Java. With no direct access to pointers,

pointer-arithmetic errors are non-existent. Using an object as a different type than what it was

originally declared to be requires an explicit cast, which gives the compiler an opportunity to

reject illogical programming, like calling a String method on an Image.
Many Java enterprise frameworks require the use of configuration files or deployment

descriptors, typically written in XML, to specify functionality: what class handles a certain

HTTP request, the order of steps to execute in a rule engine, etc. In effect, they have to go

beyond the language to implement their functionality. Critics point out that this has the

perverse effect of not only escaping Java's compiler checks, but also that a developer can no

longer determine how a program will operate just by looking at its source code. Java 5.0 adds

annotations to the language, which allows the tagging of methods, fields, and classes with

values that can then be inspected and operated on at runtime, usually through reflection. Many

programmers like annotations because they simplify tasks that might otherwise be addressed by

deployment descriptors or other means. But again, they can make it difficult to understand Java

code, as the presence or absence of an annotation may affect how the code is executed, in ways

that are in no way obvious from the annotation.
辩证的说,Java是一种“新秀级”的语言。由于Java在语法上的深思熟虑的一些限制,很多其他语言中出现的

错误不太可能出现在Java中。限制直接对指针的操作使得“指针运算”错误不复存在。当把一个对象以一种不

同于他当初定义的类别的类别使用时就需要明确的类别转换,这给了编译器排除“违法编程”的机会,这种机

会类似于对着Image类型的对象去调用String类型的方法。
很多Java企业级应用的框架要使用XML写成的配置文件或是部署描述符去定义特定的功能:这些功能类似于哪

个class处理特定的http请求,在规则引擎中处理命令的步骤等。为了实现它们的功能,这些框架超出了Java

语言的控制范围。批评者说这样做(指use of configuration files or deployment descriptors)的缺点不

仅是失去了编译器查错的机会,更重要的是开发者不再能仅仅通过查看代码就确定程序的走向。Java 5.0添加

了原数据注释功能,这种功能可以为方法,属性和类添加标签以便在运行时可以检查和操作他们。通常这是通

过反射机制实现的。很多程序员很喜欢元数据注释这项功能因为这减轻了使用部署描述符或其他方法所带来的

工作。但是这种方法仍然会让Java代码变得难于理解,因为注释的出现与否会影响程序的执行(这句怎么翻?


Despite these criticisms, Java is generally understood to be the most popular general-purpose

computing language in use today. It is a widely used standard in enterprise programming, and in

2005, it replaced C++ as the language most used by projects on SourceForge. What it has going

for it is immense: free tools (on multiple platforms: Linux, Windows, Solaris, and Mac can all

compile and execute Java apps), a vast base of knowledge, and a large pool of readily available

developers.
尽管颇有非议,但是大家都认为Java是一种使用最广泛的通用计算语言。在企业编程领域Java被广泛的使用,

在2005年,Java取代了c++成为SourceForge上被最多的项目使用的语言。Java的发展前景是非常巨大的,因为

它有大量的免费工具(在很多平台上如Linux,Windows,Solaris和Mac等都可以编译和执行Java程序),广阔的

知识基础和很多准备就绪的开发者。
The Java language hits a specific point in the tradeoff between developer productivity and code

performance: CPU cycles keep getting cheaper, developers largely don't, so it is perhaps

inevitable to accept another layer of abstraction between the developer and the execution of CPU

opcodes, if it allows the developer to create better software faster. In fact, critics of Java's

productivity, such as Bruce Tate in Beyond Java, may simply be observing this trend continuing

past Java to a new sweet spot that further trades performance for developer productivity.
Java语言在开发者的生产效率和代码的执行效率之间找到了一个最佳平衡点:CPU的频率越来越便宜,但是开

发者却并非如此。因此可能不可避免的要去接受在开发者和CPU执行代码之间平衡的另外一个层面:就是以能

否使开发者更快的生产出更好的软件作为评价标准。事实上,对Java生产效率的批评,例如Bruce Tate在其作

品Beyond Java的对Java的批评,应该注意到开发者的生产效率越来越成为首要考虑的因素而非CPU的速度。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值