|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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
|
|||
|
|||
|
Re: Advantages of each programming language
Quote:
Quote:
EDIT: If you need specific real-time help, PM me |
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
Re: Advantages of each programming language
Quote:
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
|
|||
|
|||
|
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);
}
}
|
|
#7
|
|||
|
|||
|
Re: Advantages of each programming language
|
|
#8
|
|||
|
|||
|
Re: Advantages of each programming language
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
|
|||
|
|||
|
Re: Advantages of each programming language
Memory management is an important topic in Java, the severe memory leak in SmartDashboard this year is a perfect example.
|
|
#10
|
||||
|
||||
|
Re: Advantages of each programming language
Quote:
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
|
|||
|
|||
|
Re: Advantages of each programming language
Quote:
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
|
|||||
|
|||||
|
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!
Last edited by Jared Russell : 06-03-2012 at 16:21. Reason: Java does not pass by reference |
|
#13
|
|||
|
|||
|
Re: Advantages of each programming language
Definitely, but this all depends on the commitment and/or the amount of time the student has to learn the language they choose.
|
|
#14
|
|||
|
|||
|
Re: Advantages of each programming language
<Obligatory Python pitch>
|
|
#15
|
|||
|
|||
|
Re: Advantages of each programming language
These advantages and disadvantages will differ according to your experience.
Java Advantages
C++ Advantages
LabVIEW Advantages
Python Advantages
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|