Java或C ++用于机器人编程? [英] Java or C++ for Robot programmeng?

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

问题描述

大家好!

我是自治太空机器人领域的移动机器人设计师.在C ++和Java之间为机器人选择编程语言时,我面临着巨大的困境.
对我来说,最重要的因素是该语言的性能,例如当我想将其用于非常复杂的导航算法和非常复杂的本地化策略时.
我在两个人的工作上都有经验.我使Java更加有趣,但是由于它具有特殊的编译过程,因此我认为它可以在PC上比C ++慢运行!
我试图调查他们,收集了对方的意见并找到了一些东西,但他们无法帮助我做出决定.
例如:

许多程序员认为Java更快并且性能更好,而我发现它更慢... !!!当然,有一件非常重要的事情.最后,我想在ARM微处理器或DSP上进行编程,但我不确定Java对它们的运行速度是否慢!!!

但是其他人则认为C ++比Java之类的所有语言都更强大,并且其操作明显优于Java.此外,不可否认C ++在不同机器人程序包设计中的后代.

总而言之,您对此有何看法???哪一个对我来说可能是最佳选择??

谢谢!

Hi everyone!

I am a mobile robot designer in autonomous space robotics. there is a great dilemma in front of me to opt a programming language for the robots between C++ and Java.
the most important factor for me is performance of the language when i want to use it for applying very complicated navigation algorithms and very sophisticated localization strategies, for example.
I have experience in working both of them. I got Java more interesting but because of the special compiling process which it has, I feel that it could be run on the PC slower than C++!
I''ve tried to investigate about them collected the opinions of the other and find somethings but they couldn''t help me deciding.
for example:

many of the programmers think that java is faster and have better performance whereas I found it slower...!!! of course, there is a very important thing. I finally want to program my on a ARM microprocessor or a DSP and I''m not sure that java is slow on them too or not!!!

but the others think that C++ is more powerful than all languages such as java and its operation is better than Java noticeably. furthermore, descendent of the C++ in design of different robotic packages is undeniable.

All in all, what is your opinion??? which one could be the best choice for me???

Thank you!

推荐答案

如果性能真的很重要,那么别无选择:C++Java快(前提是算法相同,比几乎所有其他方法都快).
If performance really matters, then there is no choice: C++ is faster than Java (provided the algorithm is the same, C++ is faster than almost everything else).


//我在处理这两种方法上都有经验

用自己的秒表尝试两者,
这可能是您的第一步:)
// I have experience in working both of them

Try both of them by your own stopwatch,
it could be your first move :)


对于许多应用程序,Java的运行速度几乎与C ++一样.
程序员喜欢它的一个功能是它在后台进行垃圾回收.这意味着可以建立废弃的内存,并且有时您会看到大量性能下降,因为该内存被清理了.

对于Web应用程序来说,这并不是什么大问题,但是对于要长时间连续运行的应用程序来说,这可能是个问题.

当然,作为应用程序开发人员,Java确实为您提供了管理垃圾回收的工具,但是,您失去了不必担心垃圾回收的好处.您回到了管理内存的C/C ++范式.

操作系统和许多服务器系统仍然使用C/C ++编写是有原因的.您可以针对应用程序的大小和性能进行微调,并且可以更好地控制内存管理.

我的投票是针对C/C ++的.它会提供您需要的所有功能,并具有从庞大的代码库中提取代码的能力,同时最大程度地减少了代码占用.

我相信其他人也会为Java提供出色的论据.两种语言都有优点和缺点.
Java runs nearly as fast as C++ for many applications.

One feature that programmers love about it, is that it does garbage collection in the background. This means that discarded memory can build up, and occasionally you may see large performance hits, as that memory gets cleaned up.

This isn''t a big deal for web apps, but it can be a problem for applications that will run continuously over long periods of time.

And of course, as an application developer, Java does give you facilities for managing the garbage collection, but then, you lose the benefit of not having to worry over it. You''re back in the C/C++ paradigm of managing memory.

There is a reason that operating systems and many server systems are still written in C/C++. You can finely tune your application for size and performance, and you have better control over memory management.

My vote is for C/C++. It will provide every feature you will need, and give you the capacity to draw from a huge code base, while minimizing your code footprint.

I''m sure other folks will provide excellent arguments for Java. Both languages have advantages and disadvantages.


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

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