C ++和Java [英] C++ and Java

查看:36
本文介绍了C ++和Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为一个新手,我想问一下在C ++和Java之间应用程序的区别(不是
详细信息)。在什么情况下你会使用C ++在

偏好Java,反之亦然?


我不是要求个人意见哪个是最好的*语言:)


艾伦。

As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?

I am not asking for personal opinions on which is the *best* language :)

Alan.

推荐答案

Alan Brown写道:
Alan Brown wrote:
作为一个新手,我想问一下应用程序(不是
细节)在C ++和Java之间的区别。在什么情况下你会优先使用C ++
,反之亦然?
As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in preference to Java and vice versa?



通常,更喜欢使程序员更快的编程系统。 (并且

请注意,VisualBasic会让它们变慢。)


所以,你可能想要使用一种非常高级的语言来快速

以最小的收益编码你需要的东西


Java试图模仿这种高级语言,同时保持足够的b $ b b用于向C ++用户做广告的样式语法。


如果你喜欢手动管理内存,虚拟调度,数组

bounds等,请使用C ++ .C ++封装这些在像

STL这样的系统中,事情非常顺利,但它仍然不允许程序员的速度与非常高的级别

语言一样。


如果你需要一个非常庞大而快速的程序,你必须沉迷于手动内存

管理,数组边界检查等等。所以用C ++编写类似
$ b的东西数据库或电子游戏的$ b引擎。


并且,用任何语言编写大量的单元测试。


-

Phlip
http://www.c2.com/cgi/wiki?ZeekLand


Alan Brown写道:
Alan Brown wrote:
作为一个新手,我想问一下应用程序的区别(不是
细节)是什么C ++和Java。在什么情况下你会使用C ++对Java的偏好,反之亦然?

我不是要求个人意见哪个是最好的*语言:)
As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?

I am not asking for personal opinions on which is the *best* language :)



如果要为Java虚拟机编写应用程序,请使用Java;如果您想要为其他所有内容编写应用程序,或者想要进行系统编程,请使用C ++。


-

Ioannis Vranos

http://www23.brinkster.com/noicys


* Alan Brown:
* Alan Brown:
<作为一个新手,我想问一下应用程序(不是
细节)在C ++和Java之间的区别。在什么情况下你会使用C ++优先于Java,反之亦然?


一如既往,常见问题解答是开始处理此类问题的好地方。


在这种情况下,FAQ项目6.5和6.6 。


< url:http://www.parashift.com/c++-faq-lite/big-picture.html#faq-6.5>

< quote>

在99%的情况下,编程语言选择主要取决于商业考虑因素,而不是技术考虑因素。对于开发机器的编程可用性,运行时间的可用性以及/ b $ b环境(s)对于部署机器,运行时和/或开发环境的许可/法律问题,经过培训的开发人员的可用性,咨询服务的可用性以及企业文化/

政治。这些业务考虑因素通常比编译时间性能,运行时性能,静态与动态类型,静态与动态绑定等相比具有更大的作用。

< / quote>


常见问题解答并非完美,但是(这是什么?)。它应该已经声明_main_

编程语言选择。例如,很久以前,在遥远的星系中,有一个Java项目我们需要最大化窗口

(当时不可能在Java中),以便交易使用Windows剪贴板(不是

可能在Java中,然后除了纯文本),以及我们需要一个像样的

帮助系统(在Java中不可用);我在主要Java代码使用的
C ++中实现了这些东西。仅仅几个月之后,一个Java

帮助系统就像标准的Windows一样可用,而且一半左右,大约一年左右,Java得到了更好的剪贴板操作支持,I

想想,我很可能现在已经把时间轴推迟了,很久以前。它很容易从C ++实现切换到纯Java,因为

接口很干净(单一语言提高了可维护性)。


在一个更早的Java项目中,可能甚至更远,我创建了

接口到Windows安全系统(访问检查,模拟)

in C ++ - 那么在Java中是不可能的。


C ++允许你做那些像Java这样的罐头语言的集成的东西,而不是b
,它可以让你访问硬件,它可以更有效地为某些东西,虽然这些东西的集合已经变得越来越小

多年来(类似Java的JIT编译可以是优于固定的一次 -

和所有C ++ - 比如编译wrt。效率,但并非总是如此。


C#还有对C ++的需求减少了,因为C#允许你访问基本的操作系统

功能,但是,随着C#它很容易被卡住仅在Windows *世界中,但在特定版本的Windows,.NET和工具集中。不过,C#

作为初学者的语言非常棒。 Java也是如此,但IMO并不像C#那样好(这里有很多意见空间),Turbo Pascal继承人。


我不是要求个人意见哪个是最好的*语言:)。

As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?
As always the FAQ is a good place to start getting a handle on such questions.

In this case, FAQ items 6.5 and 6.6.

<url: http://www.parashift.com/c++-faq-lite/big-picture.html#faq-6.5>
<quote>
In 99% of the cases, programming language selection is dominated by
business considerations, not by technical considerations. Things that
really end up mattering are things like availability of a programming
environment for the development machine, availability of runtime
environment(s) for the deployment machine(s), licensing/legal issues of
the runtime and/or development environments, availability of trained
developers, availability of consulting services, and corporate culture/
politics. These business considerations generally play a much greater
role than compile time performance, runtime performance, static vs.
dynamic typing, static vs. dynamic binding, etc.
</quote>

The FAQ isn''t perfect, though (what is?). It should have stated _main_
programming language selection. For example, long ago, in a galaxy far
far away, there was a Java project where we needed to maximize windows
(not possible in Java then), to deal with the Windows clipboard (not
possible in Java then except for pure text), and where we needed a decent
help system (not available in Java then); I implemented those things in
C++, used by the main Java code. Only a couple of months later a Java
help system much like the standard Windows one became available, and half
a year or so later Java got better support for clipboard operations, I
think, it''s possible I have the timeline reversed now, t''was long ago. It
was easy to then switch from the C++ implementations to pure Java because
the interfaces were clean (a single language improves maintainability).

In an even earlier Java project, possibly even farther away, I created
interfaces to the Windows security system (access checks, impersonation)
in C++ -- impossible to do in Java then.

C++ lets you do those integration things that a canned language like Java
doesn''t, and it lets you access hardware, and it can be more efficient for
some things, although the set of such things has become smaller and smaller
over the years (Java-like JIT compilation can be superior to a fixed once-
and-for-all C++-like compilation wrt. efficiency, but not always).

With C# there''s less need for C++ because C# lets you access basic OS
functionality, but then, with C# it''s easy to get stuck not only in the
Windows world, but in a particular version of Windows, .NET and toolset. C#
is great as a beginner''s language, though. And so is Java, but IMO not quite
as good for that as C# (here''s much room for opinion), the Turbo Pascal heir.

I am not asking for personal opinions on which is the *best* language :)




啊,但你是...... :-)


-

答:因为它弄乱了人们通常阅读文字的顺序。

问:为什么这么糟糕?

A:热门发布。

问:usenet和电子邮件中最烦人的是什么?



Ah, but you are... :-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


这篇关于C ++和Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆