Go to Post I didn't think it was possible for Dave to be any more cryptic. I was wrong. - IMDWalrus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-11-2010, 13:14
LeelandS's Avatar
LeelandS LeelandS is offline
Robots don't quit, and neither do I
AKA: Leeland
FRC #1405 (Finney Falcons)
Team Role: Tactician
 
Join Date: Nov 2007
Rookie Year: 2005
Location: Webster, NY
Posts: 545
LeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond reputeLeelandS has a reputation beyond repute
Java vs C++

Greeting Chief Delphi community,

As the build season comes ever closer, 1126's software team has a decision to make: What language do we use to program the robot? It's come down to Java or C++. So, in addition to what we've discussed withing ourselves, we are hoping to get some feedback from the Chief Delphi world.

We're looking for the pros and cons of using Java vs C++.

Please and thank you to anyone willing to help us,
Leeland Somerville
__________________
My heart will forever lie with SparX
1126: 2008 - 2011; Where it All Began.
1405: 2013 - Present; A Wanderer is Born.

Work hard, play hard. And maybe someday...
  #2   Spotlight this post!  
Unread 23-11-2010, 13:51
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: Java vs C++

Pros for Java:
1. Garbage Collector
2. no pointers

Pros for C++:
1. More control
2. Pointers (a two-edged sword)
  #3   Spotlight this post!  
Unread 23-11-2010, 14:47
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Mentor, LRI, MN RPC
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,816
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: Java vs C++

This question seems to come up every few months. We could go through a long list of pro's and cons about each language, but it won't tell you what you need to know. When it comes to 99% of the work a robot needs to do, there's really no difference between them. Performance is going to be more or less equivalent unless your doing a ton of graphics processing from the camera (and even then, the difference won't be terribly large).

In the end, the decision should really come down to what your team wants to do. The biggest advantage you can have with one language over the other is prior experience - If you've used Java in classes in school, that'll be a lot easier for you to work with, because you'll already understand how things work. While C++ is similar, there are some big differences that can cause some serious headaches.
  #4   Spotlight this post!  
Unread 23-11-2010, 14:47
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,814
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Java vs C++

What are you more familiar with? If you're more familiar with one than the other, go with that one and learn the other if possible.

(And the obligatory "don't forget about LabView", but I'm fairly certain you've got good reasons for not going that road.)
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

  #5   Spotlight this post!  
Unread 23-11-2010, 15:45
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Java vs C++

Quote:
Originally Posted by EricH View Post
What are you more familiar with? If you're more familiar with one than the other, go with that one and learn the other if possible.
On the other hand, it might actually be more fun to go with a less comfortable choice from the beginning. Don't just consider what you already know; think about how easy it will be for people who don't know anything yet.

Quote:
(And the obligatory "don't forget about LabView", but I'm fairly certain you've got good reasons for not going that road.)
The reasons might seem good, but they probably aren't great.

Among other things, keep in mind that LabVIEW tends to be slightly better supported by the makers of the cRIO, and that using it is presently the only official way to write your own Dashboard program.
  #6   Spotlight this post!  
Unread 23-11-2010, 15:45
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Java vs C++

Search is your friend. This has already been discussed numerous times.

since Java and C++ have been covered, how about LabVIEW? It is my language of choice, for FRC robots.


LabVIEW:
Graphical (Some like it, some hate it.)
Great amount of feedback data (The ability to probe any variable at any time is kinda handy, as is the ability to send two-way debugging data in real time when not running in competition mode)
Ability to update data while code is running (You can change cal points while the code is running)
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #7   Spotlight this post!  
Unread 23-11-2010, 17:50
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Java vs C++

http://www.youtube.com/watch?v=Ps8jOj7diA0

That talks about the difference between C/C++ and Java. I think it was this one, might have been the Abstraction lecture.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #8   Spotlight this post!  
Unread 25-11-2010, 15:23
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,704
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Java vs C++

Quote:
Originally Posted by Robototes2412 View Post
Pros for Java:
1. Garbage Collector
2. no pointers

Pros for C++:
1. More control
2. Pointers (a two-edged sword)
Technically every reference that's passed around in Java IS a pointer under the covers. The big difference is that the developer doesn't have to worry about pointers vs. pass-by-reference (i.e. whenever you see a '&' in front of a variable name that represents a large quantity of data). Java handles it all; C++ allows more control.

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).
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
  #9   Spotlight this post!  
Unread 25-11-2010, 18:29
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Java vs C++

Quote:
Originally Posted by davidthefat View Post
http://www.youtube.com/watch?v=Ps8jOj7diA0

That talks about the difference between C/C++ and Java. I think it was this one, might have been the Abstraction lecture.
It wasn't the one you linked to.



  #10   Spotlight this post!  
Unread 25-11-2010, 18:33
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Java vs C++

Quote:
Originally Posted by JesseK View Post
Sun/Oracle doesn't create a JVM for all platforms (such as embedded platforms like an Arduino).
I wonder if there would be a market for Java cross-compilers for popular microcontrollers.



  #11   Spotlight this post!  
Unread 27-11-2010, 11:07
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 333
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
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
  #12   Spotlight this post!  
Unread 27-11-2010, 11:39
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Java vs C++

Quote:
Originally Posted by taichichuan View Post
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.
Yeah, I know. I was talking about a cross-compiler (with a smart linker), not a VM.

Probably not a big enough market to justify the development expense. Maybe there are some legal issues as well.



  #13   Spotlight this post!  
Unread 27-11-2010, 12:54
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,370
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
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.
  #14   Spotlight this post!  
Unread 27-11-2010, 16:04
Foster Foster is offline
Engineering Program Management
VRC #8081 (STEMRobotics)
Team Role: Mentor
 
Join Date: Jul 2007
Rookie Year: 2005
Location: Delaware
Posts: 1,393
Foster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond repute
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.
__________________
Foster - VEX Delaware - 17 teams -- Chief Roboteer STEMRobotics.org
2010 - Mentor of the Year - VEX Clean Sweep World Championship
2006-2016, a decade of doing VEX, time really flies while having fun
Downingtown Area Robotics Web site and VEXMen Team Site come see what we can do for you.
  #15   Spotlight this post!  
Unread 27-11-2010, 16:09
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Java vs C++

Quote:
Originally Posted by Foster View Post
in the last decade I've probably read 1.2 million articles and posts on the same subject.
329 articles per day, 7 days a week, 52 weeks a year, for 10 years



Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 23:28.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi