![]() |
Java or C++
I'm debating over whether our team should switch from C++ to Java or stick with C++. I've looked over some of the forums about it and I didn't see much help. I'm looking to whether C++ is more beneficial or Java is more beneficial in relation to it's simplicity, and control.
I've done some research and found out that C++ has the ability to pass over variables and Java doesn't. I'm not sure but just asking around to see what everyone knows. I also noticed there's a large part in my community, Central Valley, switching over to Java large part to the new AP classes teaching Java, is there any other reason why the support of Java? |
Re: Java or C++
Our team has used all three programming languages since we started in 2008.
C++ was ok, but there were quite a few bugs and the documentation was really bad. We switched to LabView last year because one of the teams we partner with recommended it, but they switched to Java that year. This year we had a large intake of new software mentors (Google became one of our sponsors...) and students so we revisited what language to use. After our experiences with the other two, we landed on Java. Our code this year was the best we've ever had, and I think we'll be a "Java team" for awhile now. If there are a lot of teams in your area who use Java, switching might be a good choice so you can draw on their expertise. |
Re: Java or C++
During my first year with our FRC team, we switched to Java, primarily because that was the language taught in our high school programming classes. I was primarily a C/C++ guy beforehand, but for our purposes in robotics, I found Java to be a very good choice. I didn't notice any performance problems (outside of trying to do image processing on the cRio, which is another issue entirely), cross-platform development was nice (I'm a Linux user), and not having to deal with explicit memory management made things less complicated.
I wholeheartedly recommend Java, but I think the most important factors in a decision like this should be prior student and mentor knowledge; if you don't have someone who knows the language already, programming a whole robot with it can be quite a difficult task. |
Re: Java or C++
In terms of what makes the best robot-- they are all just tools. They all have there advantages & disadvantages. I would go with the one that you have the best local support. I get the impression that the Java & AP sort of works in reverse. Coding the robot teaches way more about under the hood aspects that you learn in AP.
|
Re: Java or C++
We switched from c++ to java this year. We really like java because of it's simplicity and documentation
|
Re: Java or C++
Quote:
The three programming languages are supposed to be equally capable for FRC, and from what I've seen teams do in the different languages, I'd say they are. The choice really comes down to what you'll have the most support with. If you have mentors that know one of the languages, go with that. If your school teaches one of the languages, go with that. If you have local support from other teams for one of the languages, go with that. |
Re: Java or C++
im probably not the best person to be discussing this topic, partly because programing is no where near my topabilities, our team uses C++ and i dont think we plan on changing it, because we are comfortable with it and it works.
|
Re: Java or C++
Quote:
As far as with bugs, the Java and C++ implementations of WPILib track rather closely now so bugs should be similar. If you mean as to build toolchain, I can't speak to that as my team has used ucpp for the past two years. If anything, my anecdotal experience is that LabVIEW broke more often - though the debugger was awesome when it worked, halfway through competition (logomotion). It also bricked without explanation once - we had to do a full reformat in order to get everything back up and running. The technical staff at the regional couldn't figure out why in either case also. The whole affair was rather strange. That's just my anecdotal experience though, and I must admit to be fair that I am not unbiased in my opinions :) As far as I'm concerned, the single greatest factor in favor of Java or C++ is that version control is *much* easier than with LV. That's saved my team on a number of occasions. I also contend that distributed systems are nicer because they let you have full access to history and make commits at the competition without an internet connection to your host. |
Re: Java or C++
I think the main advantage of JAVA over C++ is that the development tools are free unlike C++ and LabView. This makes things way easier if you have a programming team.
|
Re: Java or C++
|
Re: Java or C++
Quote:
|
Re: Java or C++
Quote:
On a different note, it's interesting to hear that the Java and C++ WPIlib impelemtations are equally buggy. I had assumed that the C++ one must be worse because the code looks like it was written by someone who wanted to be writing Java. |
Re: Java or C++
Okay thankyou everyone, this is quite alot of input. Our team has decided to move to Java, but also continue some C++ so that we can continue to compare and study the differences.
|
Re: Java or C++
I swear, I'm not trying to be the LabVIEW guy in the "Java or C++" thread, but I just wanted to comment on a few things.
I hope no one is paying money for either Wind River tools or LabVIEW tools. Teams are given as many copies as can be stuffed on the hard drives. Yes, in industry and in academia, people pay money for those products. That is how I make my house payments. Through the affiliates program, I know Bjarne Stroustrup and the A&M portion of the gcc distro guys and they live in houses too. I guess my point is that I don't see the connection between someone else paying money for something that you get for free and which tool helps your students learn to program a robot. As for source code control, it is an important aspect of SW development. LV has plug-ins for perforce and a few other SCC tools, but not for all of the recent free ones I see mentioned on CD. It looks like https://github.com/joerg/LabViewGitEnv explains how to accomplish a GIT integration, and I'm sure there are similar tutorials on other sites. On the original topic? C++ is a very powerful language, but that power makes it complex and able to make mistakes that are very difficult to debug. The other languages aren no slouches in that regard, but C++ definitely takes the cake. For an introductory language, I'd also choose Java over C++. And if you want to learn a language that takes a different approach, you might give that other one a try. Greg McKaskle |
Re: Java or C++
Quote:
BUT THERE ARE NO POINTERS IN JAVA. And this is why I never grok Java. I don't like drinking kool-aid. Learned enough to get by in class and moved on... Quote:
I also didn't say that LV didn't work with VC. But it doesn't work *as well* for me. If I'm managing my code on github, it's a lot easier for me to get a pull request, look at the plain text diffs, and automatically merge it in using a grand total of about 3 clicks and a quick mental compile than manually fetching, comparing using one tool, merging using another, and then manually pushing. It really sounds trivial but its the small frustrations in a smooth workflow that annoy me. It does work, though. We used git with LV three years ago and managed to make it work. It didn't erase the fact though that it felt like a suboptimal situation. On a completely anecdotal note, I've found it harder to convince inexperienced programmers to split their LV code into several subVIs than to split Java/C++ code into several functions. I don't know why this is. Good chance it's just my sample. I did not mean to turn this post into a diatribe... sorry all. Really, I believe LabVIEW is a good language. It's great for rapid prototyping and throwing together a quick custom dashboard. It's just not the tool I prefer to use, and deep down it's really just because I don't have as much experience with it ;-) Quote:
|
| All times are GMT -5. The time now is 03:22. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi