Java 有哪些突出的实际应用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2612434/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What Are Some Prominent Real-World Applications of Java?
提问by
I'm a beginning programmer and the I&CS program at our school starts us off learning Java. It seems to me like C and its spin-offs are way more prevalent in the real world. Is this true? How do expert programmers use Java for their work?
我是一名初级程序员,我们学校的 I&CS 课程让我们开始学习 Java。在我看来,C 语言及其衍生产品在现实世界中更为普遍。这是真的?专业程序员如何在他们的工作中使用 Java?
To be more precise, I want to know in what situations would a programmer prefer to use Java over other languages. OpenOffice is definitely a prominent example of Java, but couldn't it have been coded using anything else?
更准确地说,我想知道在什么情况下程序员更喜欢使用 Java 而不是其他语言。OpenOffice 绝对是 Java 的一个突出例子,但它不能使用其他任何东西编码吗?
采纳答案by issa marie tseng
Unless you're writing games, embedded device software, maintaining legacy software, or writing high performance parallel computation software (eg CUDA), you'll get much more mileage out of Java these days than C/C++. C# is actually more Java-derived than C-derived despite the name, in case you're thinking of that (many would argue that it's better than Java, myself included).
除非您正在编写游戏、嵌入式设备软件、维护遗留软件或编写高性能并行计算软件(例如 CUDA),否则这些天您将从 Java 中获得比 C/C++ 多得多的里程。尽管名称如此,但 C# 实际上比 C# 更源自 Java,以防您想到这一点(许多人会争辩说它比 Java 更好,包括我自己)。
The statement that "Java is slower than C/C++" is slowly but steadily becoming a myth (see for instance this benchmark). It's certainly much more programmer-friendly, and there are rapidly emerging more and more enterprise-grade solutions that specifically deal with Java, its development, and its deployment in the real world.
“Java 比 C/C++ 慢”的说法正在缓慢但稳步地变成一个神话(例如参见这个基准)。它当然对程序员更加友好,并且正在迅速涌现出越来越多的企业级解决方案,专门处理 Java 及其在现实世界中的开发和部署。
Particularly in server applications, you'll find that Java is gaining enormous ground. In most fields at this point, it's debatable whether it really is second-place to C/C++ in usage.
特别是在服务器应用程序中,您会发现 Java 正在取得巨大的进步。在这一点上的大多数领域,它是否真的在使用上仅次于 C/C++ 是有争议的。
回答by David
There are tons of JAVA applications out there. Perhaps not as many on the standard Windows desktop, but on mainframes, etc, Java is very heavily used. Also, a lot of sites still use jsp, etc. Java is a very relevant language, and will likely remain so. (Even though, personally, I would rather use .NET.)
有大量的 JAVA 应用程序。也许在标准 Windows 桌面上没有那么多,但在大型机等上,Java 被大量使用。此外,许多站点仍然使用 jsp 等。Java 是一种非常相关的语言,并且很可能会继续如此。(尽管我个人更愿意使用 .NET。)
In our company, we use Confluenceas a content management system for documentation, MAXIMO as an asset tracking software.. both of which run on Java. Most of the internal web apps that we have that interact directly with the mainframe run on JSP. For desktops, probably the most notable Java app is Open Office...
在我们公司,我们使用Confluence作为文档的内容管理系统,使用 MAXIMO 作为资产跟踪软件......两者都运行在 Java 上。我们拥有的大多数与大型机直接交互的内部 Web 应用程序都在 JSP 上运行。对于台式机,最引人注目的 Java 应用可能是Open Office...
Also, Java is a relatively nice language for learning Object-Oriented programming. A lot of what you learn in Java can be easily carried over into other OO languages (such as C#, VB.Net, C++, etc). It's a heck of a lot easier to learn than C++, so it makes for a good "learning" language. (I still think C# is easier, but that's probably a personal bias.)
此外,Java 是一种用于学习面向对象编程的相对不错的语言。您在 Java 中学到的很多东西都可以轻松地移植到其他 OO 语言(例如 C#、VB.Net、C++ 等)中。它比 C++ 更容易学习,因此它是一种很好的“学习”语言。(我仍然认为 C# 更容易,但这可能是个人偏见。)
回答by Ken
How? I open my editor, swear at Java for being so verbose and low-level (but not as low-level as C!), and then start typing.
如何?我打开我的编辑器,发誓 Java 如此冗长和低级(但不像 C 低级!),然后开始输入。
Except for slight variations in step 2, it's pretty much the same for all languages I use for work.
除了步骤 2 中的细微变化外,我用于工作的所有语言都几乎相同。
回答by T.R.
Java is perhaps second place in use to the more closely C-based languages, but it's a close enough second that I wouldn't worry too much about its applicability. More generally, I wouldn't worry too much about the applicability of the first language you learn - there are so many languages out there, each with their particular domain. Focus on learning concepts, and you won't have a hard time switching to whatever language is appropriate for the current task.
Java 在使用方面可能仅次于更接近基于 C 的语言,但它足够接近第二,我不会太担心它的适用性。更一般地说,我不会太担心您学习的第一门语言的适用性 - 那里有很多语言,每种语言都有其特定的领域。专注于学习概念,您将不会很难切换到适合当前任务的任何语言。
Regarding Java"s problem domain:
Java is often used for cross-platform applications with a graphical user interface, for cell phone applications, and on the server for generating web pages. The code that has already been written in Java in these areas is what makes it attractive for future projects in these areas - but no problem domain belongs explicitly to one language.
关于 Java 的问题域:
Java 常用于具有图形用户界面的跨平台应用程序、手机应用程序以及用于生成网页的服务器上。这些领域中已经用 Java 编写的代码是什么使其对这些领域的未来项目具有吸引力 - 但没有问题领域明确属于一种语言。
Getting a little technical:
Java is a statically typedand garbage collectedlanguage. This means that it is slightly more difficult to accidentally do unsafe things, and Integrated Development Environments(like Eclipse) can provide more help to the programmer, so Java is perhaps better suited to larger projects or projects that are likely to have programmers unfamiliar with the code base.
有点技术性:
Java 是一种静态类型和垃圾收集语言。这意味着意外做不安全的事情稍微困难一些,而集成开发环境(如 Eclipse)可以为程序员提供更多帮助,因此 Java 可能更适合较大的项目或可能让程序员不熟悉的项目。代码库。
As a garbage collected language, Java is perhaps less well suited for programs with severe resource constraints or speed requirements (where C is generally preferred). As a statically typed language, it is less suited for rapid application development (where dynamically typed languages like Python, Ruby, and PHP are generally preferred).
作为一种垃圾收集语言,Java 可能不太适合具有严重资源限制或速度要求的程序(通常首选 C)。作为一种静态类型语言,它不太适合快速应用程序开发(通常首选动态类型语言,如 Python、Ruby 和 PHP)。
More broadly, Java is also an imperative language, so its style is more familiar to most programmers, and it is better for telling the computer exactly how to do something, as opposed to, for example, functional languages(like Haskell), which may be better for describing what needs to be done, so that the computer can divide the work up as it needs to (but are not as good at dealing with things that change, like what's on the screen).
更广泛地说,Java 也是一种命令式语言,因此它的风格对于大多数程序员来说更为熟悉,并且更适合告诉计算机确切地如何做某事,而不是例如函数式语言(如 Haskell),它可能更好地描述需要完成的工作,以便计算机可以根据需要划分工作(但不擅长处理变化的事物,例如屏幕上的内容)。
回答by RarrRarrRarr
Java is quite prevalent. It's really hard to compare its prevalence with "C and its spin-offs" because no one keeps statistics on how many "real world" problems are solved with each one. Java, however, is quite popular. Some Java applications that you can install and play with on your own desktop machine:
Java 非常流行。很难将它的流行程度与“C 及其衍生产品”进行比较,因为没有人统计每个问题解决了多少“现实世界”问题。然而,Java 非常流行。您可以在自己的台式机上安装和使用的一些 Java 应用程序:
Java also runs on many cell phones and web servers.
Java 也可以在许多手机和网络服务器上运行。
As far as your second question -- expert programmers tend to use Java to get things done. (Just like C, C++, perl, Lua, python, Javascript, ruby, Clojure, Pascal, SQL, COBOL, and any other programming language.) As a beginning programmer, don't worry about the real-world applicability of Java. If your school teaches it, use it to learn the computer science concepts that will serve you in whatever language you end up using to solve prevalent real world programs.
至于你的第二个问题——专家程序员倾向于使用 Java 来完成任务。(就像 C、C++、perl、Lua、python、Javascript、ruby、Clojure、Pascal、SQL、COBOL 和任何其他编程语言一样。)作为初学者,不要担心 Java 的实际适用性。如果你的学校教它,用它来学习计算机科学概念,无论你最终使用什么语言来解决流行的现实世界程序,这些概念都会为你服务。
回答by mglmnc
You mean prominent applications that you face as a general member of the public? There aren't many, I can only think of Frostwire for one. Doesn't mean its presence is not there, before I started my programming career I have never heard of Oracle, even though right now its as big as the Coca Cola company.
您的意思是您作为普通公众面临的重要应用程序?数量不多,我只能想到 Frostwire 之一。并不意味着它不存在,在我开始我的编程生涯之前,我从未听说过 Oracle,尽管现在它和可口可乐公司一样大。
回答by Pascal Thivent
Your perception of the "real world" is maybe not accurate because many (most?) big Java applications are not "visible". Sure, there are desktop Java applications but, in my opinion, it's server-side Java that made it so popular, especially in heterogeneous corporate environments (portability brings you vendor independence) and Java is used in almost all industries. And because you asked for an example, mine would be GMail. Is that big enough?
您对“真实世界”的看法可能并不准确,因为许多(大多数?)大型 Java 应用程序并不“可见”。当然,有桌面 Java 应用程序,但在我看来,是服务器端 Java 使它如此流行,尤其是在异构企业环境中(可移植性使您独立于供应商),并且 Java 几乎用于所有行业。因为你问了一个例子,我的就是GMail。够大吗?
回答by Michael Borgwardt
Reasons for choosing Java specifically:
专门选择 Java 的原因:
- Your application must run on multiple operating systems - Java makes this easier than most other languages
- You're planning to use one of the huge number of libraries that are available in Java
- You want to be able to find developers for your project easily
- 您的应用程序必须在多个操作系统上运行 - Java 使这比大多数其他语言更容易
- 您计划使用 Java 中可用的大量库之一
- 您希望能够轻松为您的项目找到开发人员
Also, there are two misconceptions in your question:
另外,你的问题有两个误解:
- Java isa spin-off of C. Its syntax and concepts are closer to C and C++ than most other modern languages.
- OpenOffice is not written completely in Java. Some small parts are, but most of it is C++
- Java是 C的衍生产品。它的语法和概念比大多数其他现代语言更接近 C 和 C++。
- OpenOffice 并不是完全用 Java 编写的。一些小部分是,但大部分是 C++
回答by drawnonward
My personal usage of Java has been on cell phones. I ported an application to Android and BlackBerry. So for real world publicly visible usage, those operating systems and their myriad applications are fair examples.
我个人在手机上使用 Java。我将应用程序移植到 Android 和 BlackBerry。因此,对于现实世界中公开可见的使用,这些操作系统及其无数应用程序都是很好的例子。
The more I work with Java the less I like it. That is partly the developer tools (Eclipse), partly the target platform, and partly the language itself. Java is a fine first language, but at some point I hope you try others to see what you are missing.
我使用 Java 的次数越多,我就越不喜欢它。这部分是开发者工具 (Eclipse),部分是目标平台,部分是语言本身。Java 是一种很好的第一语言,但在某些时候我希望你尝试其他语言,看看你缺少什么。
回答by Philippe Beaudoin
I've been a C/C++ programmer forever, but I've recently started using Java as I write web applications using the very cool Google Web Toolkit (GWT). This little gem will compile your java code to Javascript and, if you write the server code in Java too, it can radically simplify client-server communication. I've written webapps in PHP and Python before, with raw javascript or jQuery, but to me the GWT+Java combo is a much more enjoyable solution.
我一直是 C/C++ 程序员,但我最近开始使用 Java,因为我使用非常酷的 Google Web Toolkit (GWT) 编写 Web 应用程序。这个小 gem 会将您的 java 代码编译为 Javascript,如果您也用 Java 编写服务器代码,它可以从根本上简化客户端-服务器通信。我以前用 PHP 和 Python 编写过 web 应用程序,使用原始 javascript 或 jQuery,但对我来说,GWT+Java 组合是一个更有趣的解决方案。
Granted, it's not the most popular use of Java, but I thought you might be interested to know alternate uses of the language.
当然,这不是 Java 最流行的用法,但我认为您可能有兴趣了解该语言的其他用法。