|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Java versus C++
More like Java runs slow in general on a desktop application.
I would give LabVIEW a chance and see if you like it. It's a little unconventional so some people are hesitant, but I think it has a lot of benefits. These include the intuitiveness of graphical programming, its excellent debugging tools, and easy learning curve (in my experience and as reported by many people). Here's a link that I just found recently about LabVIEW, it's very good. http://www.ni.com/labview/whatis/graphical-programming/ |
|
#2
|
||||
|
||||
|
Re: Java versus C++
There are heavily computation-intensive exceptions but most desktop applications in general are not CPU bound and therefore they run the same whether written in Java or C++. |
|
#3
|
||||
|
||||
|
Re: Java versus C++
Ok, thanks for clearing that up. I've just always heard Java is slow.
|
|
#4
|
|||
|
|||
|
Re: Java versus C++
I will tell you that it is easier to code with Java. It can be a pain in the $@#$@#$@# to fix a memory leak in C++ because of a misused pointer... But personally I love C++
|
|
#5
|
||||
|
||||
|
Re: Java versus C++
From my experience mentoring teams using both C++ & Java, I have not seen any kind of performance issues. If you already have experience in Java, go with that.
I have been posting some simple Java programming tips on my blog. Feel free to contact me if you have any questions. |
|
#6
|
||||
|
||||
|
Re: Java versus C++
Well said Roger. Consider this advice when looking at your options, it is a very good point. It always comes up in discussions like this.
|
|
#7
|
||||
|
||||
|
Re: Java versus C++
The statement "Java is slow" has been around a long time. And at one point, it was true. When Java first came out, it was slower than other languages like C. But there have been a TON of optimizations over the past 10+ years that simply make that statement not true in most cases. In fact, due in a large part to memory management, C++ can be slower than Java (Pointers are time consuming to handle for C++, malloc sucks, performance wise. You don't have those problems with Java).
for a young programmer like yourself, you have a couple of options. 1. You can go with what you already know (Java) - that will be the easiest and surest way of producing quality code for your team. The additional benefit of extra exposure to the language through the team will also help you with your classwork. Looking towards the future (aka college), you'll most likely being using Java for a lot. I know my old school has switched many classes over to Java in the past 6 years or so. Having a deeper understanding of that language now will only help you with your classwork in the future. 2. You could go with a different language for a broader experience. While this will probably be more difficult and time consuming for you, most programming jobs generally involve multiple languages - and having a broad exposure will help in the long run. For instance, right now my job requires me to know HTML, Groovy, JSP, Java, SQL, PL/SQL, and C (i think that's everything...). Additionally, learning multiple programming languages helps you to understand the basics of how languages, in general, work. You don't need to deal with pointers in Java, but working with them in C will dramatically increase your understanding of how computers work. One last thing to consider: What support do you have? Do you have any programming mentors? do they have a preferred language? Our team ended up going with Java for two reasons - first, the students were familiar with it from classes at school. Second, the mentors knew it better than C++ and could help them succeed better with it. Another team we work closely with made a different decision. They went with Labview (i think), and ran into some big problems late in the season that their mentors (who were experts in Java) couldn't help much with. Having a safety net of knowledgeable people close at hand isn't something to ignore. |
|
#8
|
||||
|
||||
|
Re: Java versus C++
Quote:
Can you please provide an authoritative reference, or experimental data, to support the claims that: 1) properly-written code using pointers in C++ runs slower than functionally equivalent code written in Java and 2) properly-written code using malloc in C++ runs slower than functionally equivalent code written in Java Thanks! |
|
#9
|
|||
|
|||
|
Re: Java versus C++
My understanding is that the JVM that's been ported to the cRIO is the squawk VM, which is not a real-time VM. While you might have your own opinions about the importance of a system being real-time or not, that was something that played into our thought process.
|
|
#10
|
||||
|
||||
|
Re: Java versus C++
Quote:
It was my understanding (perhaps incorrect) that the 2010 FRC Framework for Java was written in such a way to use the underlying vxWorks RTOS to handle the realtime aspects, thus mitigating the lack of true built-in realtime support in the VM. Not? |
|
#11
|
|||
|
|||
|
Re: Java versus C++
Quote:
I'm sorry, but I can't help but misread JVM as JVN, at least in an FRC context. |
|
#12
|
|||
|
|||
|
Re: Java versus C++
While I'm pretty sure I can build a car that operates more slowly than a bike, or find a turtle that outruns a hare, I'd caution against drawing general conclusions from such benchmarks.
One of the fundamental underpinnings of computer science is examining a problem and determining the inherent complexity, looking at a solution and determining the way it scales based on it's inputs, and getting beyond qualitative terms such as fast and slow. You have choices as to which tools to use, and I wouldn't personally base the decision on runtime performance. Instead look what will support agility, productivity, and reliability. Also consider what enables your team to learn new things and to pass the knowledge on to the next generation of your team. Greg McKaskle |
|
#13
|
|||||
|
|||||
|
Re: Java versus C++
Quote:
![]() Quote:
All of this really only matters if you are in a hard-real time, safety-critical situation. If for example you are building an airbag deployment system, you have a few milliseconds to react to a crash. In this scenario you can't afford the one in a million chance that your code is busy garbage collecting and thus blocking the execution of the real-time critical bit. In a FIRST robot, missing a real-time deadline by a little bit is (a) not going to be life threatening and (b) not going to occur often at all anyway. The worst possible scenario would be a fast software control loop ending up with a little bit more jitter (variation in time between calls). Last edited by Jared Russell : 22-09-2010 at 19:33. |
|
#14
|
|||
|
|||
|
Re: Java versus C++
Quote:
If you know what I mean, I don't name what I do. |
|
#15
|
||||
|
||||
|
Re: Java versus C++
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION*** | Pjohn1959 | Programming | 37 | 31-08-2009 15:55 |
| Cable Versus Chain | Darren Collins | Technical Discussion | 1 | 14-01-2008 22:29 |
| Bernoullis versus Continuity | Corey Balint | Math and Science | 13 | 15-09-2007 17:59 |
| PC versus Console | Denman | Chit-Chat | 40 | 22-05-2005 18:01 |
| Reigonals versus startegies | MisterX | Rules/Strategy | 11 | 29-03-2004 00:04 |