7 reasons Java is still great

Java has endured radical transformations in the technology landscape and many threats to its prominence. What makes this technology so great, and what does the future hold for Java?

Java在技术领域经历了彻底的变革,并面临许多威胁。是什么让这项技术如此伟大? Java的未来会是怎样的?

Among the most fascinating phenomena in software is the enduring prominence of Java. As both a language and a platform, Java has survived radical transformations in the technology landscape, and its own internal structure has altered along with it. How has Java remained at the center of both enterprise and open source for more than two decades? Let's look at a few factors that stand out.

软件领域最令人着迷的现象之一是Java经久不衰的突出地位。作为一种语言和平台,Java在技术领域的激进变革中幸存下来,它自己的内部结构也随之改变。Java是如何在二十多年的时间里保持企业和开源的中心地位的?让我们来看看一些突出的因素。

The Java Community Process (java 社区进程)

Java began life as an alternative to the conventional way of doing things—an upstart of sorts. Today, despite repeated challenges, it is recognized as a pillar of enterprise software. What explains Java's continued relevance in the face of such radical change? One essential factor is the passion of the community, which is fostered through governance structures that engage developers to keep Java a living, dynamic force.

Java诞生之初是作为传统做事方式的一种替代——某种意义上的暴发户。今天,尽管面临着反复的挑战,它仍然被认为是企业软件的支柱。如何解释Java在面对如此激进的变化时仍然具有相关性?一个重要的因素是社区的热情,这种热情是通过管理结构来培养的,这种治理结构使开发人员参与进来,使Java成为一种活跃的、动态的力量。

Far from a smoothly operating machine, Java's governance is a confusing amalgam of competing interests and organizations that find their voice in the Java Community Process (JCP) and through Java Specification Requests (JSRs). At the end of the day, the JCP is a venue for contribution and conflict resolution among people who care deeply about Java technology. It is a rather mystifying combination of bureaucracy, policy, and creativity. Something like a functioning democracy, in fact.

Java的治理远非一个平稳运行的机器,它是相互竞争的利益和组织的一个令人困惑的混合体,这些利益和组织在Java社区进程(JCP)和Java规范请求(jsr)中找到了自己的声音。在一天结束的时候,JCP是对Java技术非常关心的人们进行贡献和解决冲突的场所。这是官僚主义、政策和创造力的一个相当神秘的组合。事实上,类似于一个正常运转的民主国家。

As a longtime Java programmer, it was surprising—astonishing, actually—to watch the language successfully incorporate lambdas and closures. Adding functional constructs to an object-oriented programming language was a highly controversial and impressive feat. So was absorbing concepts introduced by technologies like Hibernate and Spring (JSR 317 and JSR 330, respectively) into the official platform. That such a widely used technology can still integrate new ideas is heartening.

作为一名长期从事Java编程的程序员,看到这种语言成功地将lambda和闭包结合在一起,我感到非常惊讶。向面向对象的编程语言中添加函数结构是一项极具争议性和令人印象深刻的壮举。将Hibernate和Spring(分别为JSR 317和JSR 330)等技术引入的概念吸收到官方平台中也是如此。如此广泛使用的技术仍然可以整合新思想,这令人振奋。

Java's responsiveness helps to ensure the language incorporates useful improvements. it also means that developers know they are working within a living system, one that is being nurtured and cultivated for success in a changing world. Project Loom—an ambitious effort to re-architect Java’s concurrency model—is one example of a project that underscores Java's commitment to evolving. Several other proposals currently working through the JCP demonstrate a similar willingness to go after significant goals to improve Java technology.

Java的响应性有助于确保该语言包含有用的改进。这也意味着开发人员知道他们是在一个活生生的系统中工作,一个在不断变化的世界中为成功而培育和培养的系统。Project loom是一个重新构建Java并发模型的雄心勃勃的项目,它是一个强调Java致力于不断发展的项目的例子。目前正在通过JCP工作的其他几个提案表明了类似的意愿,即追求改进Java技术的重要目标。

The people working on Java are only half of the story. The people who work with it are the other half, and they are reflective of the diversity of Java's many uses. Social coding and open source are not unique to Java, but they are key constituents in the health of the Java ecosystem. Like JavaScript, Java evolved in tandem with the coding community as the web gained traction. That origin story is a big part of its character.

开发Java的人只是故事的一半。与它一起工作的人是另外一半,他们反映了Java的许多用途的多样性。社交编码和开源并不是Java独有的,但它们是Java生态系统健康的关键组成部分。与JavaScript一样,随着web的发展,Java也随着编码社区的发展而发展。这个起源故事是它性格的重要组成部分。

Open source frameworks and tools(开源框架和工具)

Another big driver of Java's success is the wealth of open source frameworks and tools built up around it. Almost anything you might need has one or more available libraries. If you like a project, there is a good chance it's open source and you can contribute to it. That's great for both learning and building community.

Java成功的另一个重要驱动力是围绕它构建的大量开源框架和工具。几乎所有您可能需要的东西都有一个或多个可用的库。如果您喜欢一个项目,那么它很有可能是开源的,您可以为它做出贡献。这对学习和建立社区都很有帮助。

Not long ago I had my hands deep in parsing YAML, and discovered the SnakeYAML project. Soon, I was off in the weeds trying to do something exotic with this new project. Not long after that, I was chatting with the project's owner.

不久前,我开始深入研究解析YAML,并发现了SnakeYAML项目。很快,我就开始尝试在这个新项目中做一些具有异国情调的事情。不久之后,我和这个项目的负责人聊天。

Something similar happened when I needed to do some sophisticated process orchestration close to the metal. First, I discovered the NuProcess project, then I got to contribute a small fix. Exchanges like that make a programmer's life richer. They're also how open source projects evolve.

当我需要做一些复杂的流程编排时,类似的事情也发生了。首先,我发现了NuProcess项目,然后我贡献了一个小修复。这样的交流使程序员的生活更加丰富。它们也是开源项目发展的方式。
 

The wealth of projects in the Java ecosystem extends from modest examples like the ones I've shared to database drivers and similar technologies, on up to the monumental. There are application servers like Tomcat and Jetty, frameworks like Hibernate, and even the Eclipse IDE. All are open source projects that invite contributors.

Java生态系统中的项目丰富,从我所分享的那些普通的例子,到数据库驱动程序和类似的技术,一直到巨大的项目。有像Tomcat和Jetty这样的应用服务器,像Hibernate这样的框架,甚至还有Eclipse IDE。所有这些都是邀请贡献者的开源项目。

Spring dependency injection (Spring 依赖注入)

No appreciation for Java’s ecosystem would be complete without tipping our hat to Spring. This meta-framework is perhaps the standard to which other meta-frameworks might aspire. Why? Because Spring lets you use the same facility for composing custom code and incorporating third-party code in your programs. Through its implementation of dependency injection and inversion-of-control, Spring not only enables you to make your own internal components more standard, but it extends a similar standardization to how third-party projects and vendors prepare their components. This makes for greater consistency in how you use these components in your programs.

Of course, there are valid critiques of Spring, and it's not always the right tool. Google Guice is another tool that works similarly to Spring. But Spring, as a framework, introduced a clean and consistent way to provision and compose application components. That was a game changer at the time, and it continues to be vital today.

Everything is an object(一切皆是对象)

If the people behind Java and using Java are the wind that keeps the ship sailing, then Java's technical aspects are the sails. It is impressive that the initial Java specification sprung Athena-like from a single head (the head of James Gosling) but has remained flexible enough to still be relevant today. 

如果Java背后的人和使用Java的人是使船保持航行的风,那么Java的技术方面就是帆。令人印象深刻的是,最初的Java规范是由一个人(James Gosling的头)像雅典娜一样产生的,但它保持了足够的灵活性,直到今天仍然具有相关性。

An important feature of Java's design is that, in Java, everything is an object.

Java设计的一个重要特征是,在Java中,一切都是对象。

In a development landscape that currently favors functional programming, it's sometimes fashionable to trash this aspect of Java and object-oriented programming. Java's stewards have responded by incorporating some functional programming idioms into the language. But they've been steadfast in that Java remains a strongly object-oriented language where everything is, indeed, an object.

在当前倾向于函数式编程的开发环境中,有时流行抛弃Java和面向对象编程的这一方面。作为回应,Java的管理者将一些函数式编程习惯融入到语言中。但他们一直坚定地认为,Java仍然是一种强烈面向对象的语言,其中所有东西实际上都是对象。

It’s possible to write code that is awesome or awful in any paradigm. Going into a Java system, you know up front that it's strongly typed and that everything is contained in classes. The absoluteness of this design decision cuts away complexity and lends cleanness to the language and programs that use it. Well-written Java programs have the mechanical elegance of well-written object-oriented code. The functionality is the result of interacting components, like gears in a machine. 

在任何范例中,都有可能编写出令人敬畏或糟糕的代码。进入Java系统,您一开始就知道它是强类型的,并且所有内容都包含在类中。这种设计决策的绝对性减少了复杂性,并使使用它的语言和程序变得简洁。编写良好的Java程序具有编写良好的面向对象代码的机械优雅性。功能是组件相互作用的结果,就像机器中的齿轮一样。

The cost of this approach is confusion in the early stages of learning. Virtually every Java beginner confronts key questions: what is the keyword there for, what is a class, and why on earth do I need to write "" just to print "hello world"?publicpublic static void main(String[] args)

这种方法的代价是在学习的早期阶段产生混乱。实际上,每个Java初学者都会遇到一些关键问题:关键字的作用是什么,类是什么,为什么我需要写“”来打印"hello world"?publicpublic static void main(String[] args)

But consider that those learning curves are potent aspects of a large-scale order: The beginner is encountering and absorbing sophisticated concepts that are fundamental to the Java way of doing things. You could say that the strictly class-based structure of Java programs lends itself to good programming-in-the-large. As systems grow in size, the structure, which might seem unwieldy at a smaller scale, becomes more beneficial. In many cases, it vindicates the burden of early-phase learning.

但是要考虑到这些学习曲线是大规模顺序的有力方面:初学者正在遇到并吸收复杂的概念,这些概念是Java做事方式的基础。您可以说,Java程序的严格基于类的结构有助于实现良好的大型编程。随着系统规模的增长,在较小规模下看起来笨拙的结构变得更加有益。在许多情况下,它证明了早期学习的负担是正确的。

There are legitimate gripes about Java syntax, to be sure—the same is true of JavaScript and every other language. As Bjarne Stroustrup once said, “There are only two kinds of languages: the ones people complain about and the ones nobody uses.”

可以肯定的是,对Java语法的抱怨是合理的,JavaScript和其他语言也是如此。正如Bjarne Stroustrup曾经说过的:“世界上只有两种语言:人们抱怨的语言和没人用的语言。”

The JVM(虚拟机)

The Java virtual machine is another facet of Java’s construction that meets with occasional critique. At the time of its development, the JVM was a bold technical solution to the diversity of runtime environments. Since then, it has sometimes seemed a burden of excess architecture and a source of performance difficulties. But after years of incessant refinement, the technology has gradually vindicated itself. It has proved rather prescient, as well. The world has lately become enamored of virtual machines; they are everywhere, even forming the lowest strata of cloud computing.

Java虚拟机是Java构造的另一个方面,偶尔会遇到批评。在其开发时期,JVM是一个大胆的技术解决方案,以应对运行时环境的多样性。从那时起,它有时似乎成为过度架构的负担和性能困难的来源。但经过多年的不断改进,这项技术逐渐证明了自己的正确性。事实也证明,它相当有先见之明。最近,世界开始迷恋虚拟机;它们无处不在,甚至形成了云计算的最底层。

Applied to devops containers and serverless architectures, the JVM offers a clear-cut deployment environment target, with well-defined characteristics and controls. Modern Java virtual machines are also something to behold. They deliver sophisticated automatic memory management with out-of-the-box performance approaching C.

应用于devops容器和无服务器架构,JVM提供了明确的部署环境目标,并具有良好定义的特征和控制。现代Java虚拟机也值得关注。它们提供复杂的自动内存管理,开箱即用的性能接近C。

Enterprise creativity(企业创造力)

Software development is made up of two powerful currents: the enterprise and the creative. There's a spirit of creative joy to coding that is the only possible explanation for, say, working on a dungeon simulator for 25 years. That creativity, united with solid business use, is the alchemy that keeps Java alive and well. For long-term success, a software project must make room for both. Java has done that.

软件开发由两股强大的潮流组成:企业潮流和创意潮流。编码是一种创造性的乐趣,这是我在地下城模拟游戏中工作了25年的唯一可能解释。这种创造性与坚实的业务用途相结合,是使Java保持活力和良好的炼金术。为了长期的成功,软件项目必须为两者留出空间。Java做到了这一点。

WebAssembly and the future of Java(WebAssembly和Java的未来)

In a parting note, let’s identify one more potentially watershed event on the horizon: WebAssembly, or WASM. Java in WASM is currently limited, and there’s no certainty about how the future will unfold. But it’s possible that Java may one day be used in the browser much like JavaScript is—that is, with full access to the DOM and browser API. Imagine Java in the browser again, but this time for real. Stranger things have happened.

最后,让我们确定另一个潜在的分水岭事件:WebAssembly或WASM。WASM中的Java目前是有限的,未来将如何发展还不确定。但是有一天,Java可能会像JavaScript一样在浏览器中使用,也就是说,可以完全访问DOM和浏览器API。想象一下浏览器中的Java,但这次是真实的。更奇怪的事情发生了。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值