Go to Post If you have the time to be caught up on Delphi and the Q&A forum, then you have time to go write a WFA entry. No more excuses. Go! Write! Now! :) - Jessica Boucher [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 03-05-2012, 12:19 PM
cierra_shawe's Avatar
cierra_shawe cierra_shawe is offline
Registered User
FRC #3995 (Automata)
Team Role: Leadership
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Bend, Oregon
Posts: 10
cierra_shawe is an unknown quantity at this point
Advantages of each programming language

Hi everyone!

Although it is only 3 days until our first regional, we have yet to solidify what programing language will be used. I was wondering what the advantages of each would be, and availability of teams who would be able to help at the regional. Also any other tips to help our rookie team out would also be great!

__________________
+ =
  #2   Spotlight this post!  
Unread 03-05-2012, 04:16 PM
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,112
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: Advantages of each programming language

Use whatever language you're most comfortable with. What did you program with while you were developing and testing your robot?
  #3   Spotlight this post!  
Unread 03-05-2012, 04:54 PM
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Advantages of each programming language

Quote:
Originally Posted by cierra_shawe View Post
Although it is only 3 days until our first regional, we have yet to solidify what programing language will be used.
I sincerely hope you've already programmed your robot


Quote:
Originally Posted by cierra_shawe View Post
I was wondering what the advantages of each would be, and availability of teams who would be able to help at the regional. Also any other tips to help our rookie team out would also be great!
There are tons of threads out there on this, but I'll offer some quick points
  • There's a fair amount of support at regionals in all three official languages, but LabVIEW seems to take a majority
  • I'm not American, but I believe many American high school comp sci courses (specifically AP level) teach Java
  • Java and C++ have a fair amount of similar syntax
  • SmartDashboard can be extended with Java, default Dashboard can be extended with LabVIEW

EDIT: If you need specific real-time help, PM me
  #4   Spotlight this post!  
Unread 03-05-2012, 04:58 PM
andreboos andreboos is offline
Registered User
FRC #3021 (The Agency)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: San Diego
Posts: 132
andreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the rough
Re: Advantages of each programming language

Java and C++ compile and deploy much faster than LabVIEW, or at least that was the case last year. We use C++, and it takes 5-10 seconds to compile and 3 to deploy our code, which really cuts down on programming development time. LabVIEW takes several minutes. That said, LabVIEW is far easier for beginners at programming.
  #5   Spotlight this post!  
Unread 03-05-2012, 04:59 PM
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Advantages of each programming language

Quote:
Originally Posted by andreboos View Post
Java and C++ compile and deploy much faster than LabVIEW, or at least that was the case last year. We use C++, and it takes 5-10 seconds to compile and 3 to deploy our code, which really cuts down on programming development time. LabVIEW takes several minutes. That said, LabVIEW is far easier for beginners at programming.
LabVIEW also has some very nice debugging tools.

Disclaimer: That being said, I use C++ for the robot and this year quite a bit of Java for the dashboard and won't be switching anytime soon.
  #6   Spotlight this post!  
Unread 03-05-2012, 11:20 PM
Ziv Ziv is offline
Has code to be writing...
FRC #0125 (Nutrons)
Team Role: Alumni
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Boston
Posts: 39
Ziv is a glorious beacon of lightZiv is a glorious beacon of lightZiv is a glorious beacon of lightZiv is a glorious beacon of lightZiv is a glorious beacon of light
Re: Advantages of each programming language

Code:
if(youKnowAnyLanguage) {
    use(theLanguageYouKnow);
} else {
    read(WPILibCookbook);
    if(youUnderstoodAnyOfThat) {
        use(java); // C++ is an option, but it's a bit fiddly.
    } else {
        use(labview);
    }
}
An experienced FRC programmer using Java (and presumably any other language) can get a passable program running in a matter of hours, not days. Nevertheless, start learning and/or coding ASAP!
  #7   Spotlight this post!  
Unread 03-05-2012, 11:22 PM
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Advantages of each programming language

Quote:
Originally Posted by Ziv View Post
// C++ is an option, but it's a bit fiddly.
Care to elaborate?
  #8   Spotlight this post!  
Unread 03-05-2012, 11:26 PM
Ziv Ziv is offline
Has code to be writing...
FRC #0125 (Nutrons)
Team Role: Alumni
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Boston
Posts: 39
Ziv is a glorious beacon of lightZiv is a glorious beacon of lightZiv is a glorious beacon of lightZiv is a glorious beacon of lightZiv is a glorious beacon of light
Re: Advantages of each programming language

Quote:
Originally Posted by basicxman View Post
Care to elaborate?
If I were teaching someone to program and I had a choice as to whether or not I had to explain memory management, I would choose not having to. But it's not that big of a deal. Besides, every language has its own special problems .
  #9   Spotlight this post!  
Unread 03-05-2012, 11:27 PM
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Advantages of each programming language

Quote:
Originally Posted by Ziv View Post
If I were teaching someone to program and I had a choice as to whether or not I had to explain memory management, I would choose not having to. But it's not that big of a deal. Besides, every language has its own special problems .
Memory management is an important topic in Java, the severe memory leak in SmartDashboard this year is a perfect example.
  #10   Spotlight this post!  
Unread 03-06-2012, 12:03 AM
carrillo694's Avatar
carrillo694 carrillo694 is offline
Alex Carrillo
FRC #0694 (Stuypulse)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: New York, NY
Posts: 66
carrillo694 is a jewel in the roughcarrillo694 is a jewel in the roughcarrillo694 is a jewel in the roughcarrillo694 is a jewel in the rough
Re: Advantages of each programming language

Quote:
Originally Posted by basicxman View Post
Memory management is an important topic in Java, the severe memory leak in SmartDashboard this year is a perfect example.
For the purposes of programming a robot in only three days and not testing it until practice day, memory management probably is not their primary concern

cierra_shawe, what programming languages are you or those on your team familiar with? If the answer is "none," I am leaning towards recommending LabVIEW. Not because it is necessarily easier, but because its control structures seem more intuitive than the syntax that comes with Java or C++. If the answer is "some," then I would go with Java, because its WPIlib implementation seems simpler than the C++ implementation, which makes it easier to learn. But I could be wrong about that, since my team uses Java. At least you will not need to be concerned about memory management if you are unfamiliar with it, unless you are doing computer vision, which I do not recommend if you are testing your robot for the first time in a few days!
  #11   Spotlight this post!  
Unread 03-06-2012, 11:51 AM
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Advantages of each programming language

Quote:
Originally Posted by carrillo694 View Post
If the answer is "none," I am leaning towards recommending LabVIEW. Not because it is necessarily easier, but because its control structures seem more intuitive than the syntax that comes with Java or C++.
I really think this depends on your background. LabVIEW control structures can be intimidating and non-obvious at first. The way a LabVIEW program executes is quite a bit different than a C++/Java program. If a student has a background or enjoys math or algorithms they might find C++/Java more intuitive to them. If a student has a background in electrical they might find LabVIEW more intuitive to them.

Quote:
Originally Posted by carrillo694 View Post
If the answer is "some," then I would go with Java, because its WPIlib implementation seems simpler than the C++ implementation, which makes it easier to learn.
I don't think this is entirely correct, the components inside the WPILib for Java and C++ are abstracted at essentially the exact same level - it's really about which ever language you're more comfortable with.
  #12   Spotlight this post!  
Unread 03-06-2012, 11:57 AM
Jared Russell's Avatar
Jared Russell Jared Russell is online now
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,069
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Advantages of each programming language

I would argue that starting from scratch, it is easier for a student programmer to use Java (for FRC) than C++ (for FRC).

I cannot count the number of times I have been asked to help a team with C++ and seen problems like the following...

Code:
Victor myVictor(1);

myVictor->set(0.0); // Error!
Code:
Victor *myVictor = new Victor(1);

myVictor.set(0.0); // Error!
Code:
Victor *myVictor;

myVictor->set(0.0); // Error!  You declared, but did not substantiate, your Victor!
Code:
void SomeFunction(Victor victor)
{
victor.set(0.0);
}

Victor *myVictor = new Victor(1);

SomeFunction(myVictor); // Error!
Code:
void SomeFunction(Victor victor)
{
victor.set(0.0);
}

Victor myVictor(1);

SomeFunction(myVictor); // Still an Error!  You are making a copy of your Victor!
In Java you don't have to worry about objects on the stack vs. the heap (they are all on the heap), pass by reference vs. pass by value (always pass by value, even if your "value" is itself a reference to an object), memory leaks, C++ name mangling in compiler errors, initializing static class members outside of the class declaration, etc.

Last edited by Jared Russell : 03-06-2012 at 04:21 PM. Reason: Java does not pass by reference
  #13   Spotlight this post!  
Unread 03-06-2012, 12:00 PM
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Advantages of each programming language

Quote:
Originally Posted by Jared341 View Post
I would argue that starting from scratch, it is easier for a student programmer to use Java (for FRC) than C++ (for FRC).

I cannot count the number of times I have been asked to help a team with C++ and seen problems like the following...

<snipped>
Definitely, but this all depends on the commitment and/or the amount of time the student has to learn the language they choose.
  #14   Spotlight this post!  
Unread 03-06-2012, 12:02 PM
remulasce remulasce is offline
Registered User
no team
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Mtn View
Posts: 138
remulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to behold
Re: Advantages of each programming language

<Obligatory Python pitch>
__________________
Student 294: 2007-2011
Mentor 597: 2013-2015
Google SWE: 2015-
  #15   Spotlight this post!  
Unread 03-06-2012, 01:12 PM
ianonavy ianonavy is offline
Programming Mentor/Alumnus
AKA: Ian Adam Naval
FRC #3120 (RoboKnights)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2008
Location: Sherman Oaks
Posts: 32
ianonavy is an unknown quantity at this point
Re: Advantages of each programming language

These advantages and disadvantages will differ according to your experience.

Java
Advantages
  • Can be programmed on Windows, Mac and Linux.
  • Forces good programming patterns such as object-orientation.
  • Simpler than C++.
  • No explicit memory management. You don't have to worry about handling specific memory addresses.
  • It's the AP Computer Science language, so if any of your students are taking that course, you don't have to learn a new language.
Disadvantages
  • Incomplete vision tracking APIs.
  • No explicit memory management. (Yes, this is both an advantage and a disadvantage.)

C++
Advantages
  • Executes and compiles much faster than LabVIEW.
  • Has complete vision tracking libraries.
  • Explicit memory management, so you don't ever have memory leaks if you know what you're doing.
  • Most popular, so more teams are likely to be able to help you at the competition.
Disadvantages
  • Syntax can be confusing for new programmers.
  • Requires a Windows PC to upload code.

LabVIEW
Advantages
  • Data flow is more intuitive than object-orientation in other languages.
  • Arguably easiest to teach among the three major supported languages.
  • Has access to the most NI vision libraries.
  • Very quick debugging tools. You can probe wires in the code while you're running it to see what the problem is very quickly.
  • Garbage collection means no explicit memory management.
Disadvantages
  • It's likely you know text-based languages already, so it could be harder to learn the data flow paradigm.
  • Only runs on Windows PCs.

Python
Advantages
  • You do NOT need to restart the cRIO to upload code, which is great for rapid development.
  • Uses the C++ cRIO image, so you can switch between the two if need be.
  • Simplest syntax of all of them. It's quite beautiful, and it's very easy to teach.
  • You can develop on any platform in any IDE.
  • Access to all of Python's fantastic modules.
Disadvantages
  • Depending on your IDE, a syntax error can go unnoticed, so you have to run tests that execute every line of code.
  • This language is not supported, so you won't get much help at the competition.

Honestly, write your programs in the language with which you are most comfortable. If you're caught between two or more, figure out which is the best for what you're trying to do. LabVIEW is much better for vision tracking than say Java, but if you need Java's higher level features, go for that.
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


All times are GMT -5. The time now is 07:10 PM.

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