|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Java vs C++
Quote:
In the FRC world, I'm not sure what the difference is. In industry, Java is hardware and operating system independent so long as a JVM exsists (Sun/Oracle provides the JVM), where a C++ must be compiled specifically for a platform and even a specific version of the platform. This means that Java developed for Linux typically also works in Windows (ignoring any full-path file system stuff). It also means that C++ can go on more systems than Java since Sun/Oracle doesn't create a JVM for all platforms (such as embedded platforms like an Arduino). |
|
#2
|
||||
|
||||
|
Re: Java vs C++
Quote:
|
|
#3
|
||||
|
||||
|
Re: Java vs C++
The JVM tends to be rather memory hungry. The reason there's no JRE for the Arduino is that Java simply takes too much RAM to run on the memory footprint of an ATMega part.
There are some Java implementations that are lean. The Dalvik VM found on Android platforms is one example. However, that VM uses a just-in-time (JIT) compiler (Android 2.2+) and a register-based VM rather than Oracle's stack-based VM. The register-based VM is more efficient and better suited to JIT compilation. However, these are the very reasons that Oracle is suing Google. Also, Oracle seems to be backing out on their support for open source Java solutions (just ask the Apache folks). So, the future of Java as anything other than a proprietary platform is in question at the moment. On the other hand, C/C++ has been a standard for embedded development for almost 30 years and doesn't seem to be going away any time soon. In fact, most of the JVMs are written in C/C++. If limited memory footprints are in your future, then Java is not the solution. All that being said, Java tends to work just fine for FRC robots. You're typically not running long enough for the garbage collection cycle to become an issue, and 64MBs of RAM is really quite a lot for many applications. The other advantage of Java is that it's the language used on the AP exams. So, many of your team may already have some Java experience. I think it was summed up earlier in this thread, you go with what your team may already have experience with. C/C++ execution is arguably faster than Java, but FRC competitions are typically not won or lost on a microsecond scale. The additional complexity of C/C++, while it may make them arguably more employable in the embedded marketplace, can be daunting for first-time developers. HTH, Mike |
|
#4
|
||||
|
||||
|
Re: Java vs C++
Quote:
Probably not a big enough market to justify the development expense. Maybe there are some legal issues as well. |
|
#5
|
|||
|
|||
|
Re: Java vs C++
This isn't for FIRST but, Microsoft has the .NET Micro Frame work. I've been playing with these products.
http://www.tinyclr.com/ C# is similar to java and It's nice to plug a joy stick into a controller and have a device class at your disposal. On the other hand things that require interrupts and timing like quadrature encoders are more of a problem. Playing with a 70 mhz arm 7 with out absorbing over 1000 pages of chip manual is nice. Visual studio express C# is free and not to bad a environment. This also allows people who have no micro controller experience but .net talent to dive into micro's with some familiarity. |
|
#6
|
|||
|
|||
|
Re: Java vs C++
There have been lots and lots of posts about the C/C++ vs Java, the search bar is your friend. I've been in the software business for a long time, so in the last decade I've probably read 1.2 million articles and posts on the same subject.
Given a choice of all the software out there at this point I'd do either the Lua or Python implementation, most likely the Lua one since I have experience with Lua in other applications. Reasons: the long download and build times for Labview, the concept of doing a FTP download and having code ready to run is good. Being able to write short modular code helps. I've never been happy with the way Labview code is intertwined. All I can say for sure is "Know the Language You are Writing In Before Build Season Starts". January is not the time to learn a new language, new environment, new way of doing things. |
|
#7
|
||||
|
||||
|
Re: Java vs C++
Quote:
|
|
#8
|
|||
|
|||
|
Re: Java vs C++
Quote:
Quick Google of Java vs C++ gets "About 39,500,000 results" so I've clearly only read the tip of the iceburg. ![]() |
|
#9
|
||||
|
||||
|
Re: Java vs C++
As a current meche student, id say go with java. im taking a class in c right now, and its not all that bad, but learning pointers took me and most of my class quite awhile, and to be honest they still confuse me sometimes. i took java last semester, and had no difficulty with anything we did in that course. now this is just my viewpoint from an outside-frc stance, but i still like java more. but as has been said before, go with what you are more comfortable with, thats going to make the biggest difference. dont waste time to learn something you dont have to.
|
|
#10
|
|||
|
|||
|
Re: Java vs C++
You had me until ...
Not sure what you intended to say, but in my mind, it is far better to learn about several approaches and make an informed decision, than to assume what you already understand is best. Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parallelism in Java | Egg 3141592654 | Java | 4 | 01-04-2010 17:21 |
| Android Java | Team 1708 Dave | Java | 2 | 18-01-2010 22:35 |
| Java | team1512 | Java | 2 | 21-10-2009 06:36 |
| Java vs. C++ | nickmagus | Programming | 3 | 05-09-2009 19:23 |
| **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION*** | Pjohn1959 | Programming | 37 | 31-08-2009 15:55 |