Go to Post So... the question is this: Does Grady keep his stuffed animals on his Barbie House for playtime, or in his bed to help him go sleepy-pie at night-night time? - Andy Baker [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
  #16   Spotlight this post!  
Unread 03-06-2012, 01:30 PM
wireties's Avatar
wireties wireties is online now
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,168
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Advantages of each programming language

There are many environments (in the real world) where C and C++ is only choice, favorite or not. For example the Linux kernel and drivers are written in C. The native API for the OS on the robot (VxWorks) is in C, all the other APIs are only a wrapper. Drivers and board support packages for VxWorks are written in C only.

I would advise a student looking to be a computer scientist that Java is a viable choice. If the student is going to be an engineer (especially in embedded systems and robotics), C/C++ is a better choice. C/C++ is not going away any time soon and C++ is not so different from Java that training in Java (which many high schools provide) is not applicable.

What are Oracle and Microsoft plans for Java? Will Java diverge? Will HTML5 and/or C# kill Java? Who knows? LabView and Python are awesome environments but not (works everywhere for everything) primary tools, they are specialized 4GL tools.

Also, (in FRC) using a language your mentor knows is a primary consideration.

HTH
__________________
Fast, cheap or working - pick any two!

Last edited by wireties : 03-06-2012 at 01:35 PM.
  #17   Spotlight this post!  
Unread 03-06-2012, 01:38 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 wireties View Post
I would advise a student looking to be a computer scientist that Java is a viable choice.
Care to elaborate? What do you define as a computer scientist?

Quote:
Originally Posted by wireties View Post
LabView and Python are awesome environments but not (works everywhere for everything) primary tools, they are specialized 4GL tools.
Is this a problem? FRC is a very specialized application.

Quote:
Originally Posted by wireties View Post
Also, (in FRC) using a language your mentor knows is a primary consideration.
Seconding this.
  #18   Spotlight this post!  
Unread 03-06-2012, 01:44 PM
wireties's Avatar
wireties wireties is online now
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,168
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Advantages of each programming language

Quote:
Originally Posted by basicxman View Post
Care to elaborate? What do you define as a computer scientist?
A student planning on getting a computer science degree rather than engineering or physics.

Quote:
Originally Posted by basicxman View Post
Is this a problem? FRC is a very specialized application.
I was thinking the skills from FIRST can help in college and in a career.

Both my kids learned Java from an awesome teacher at the high school and C++ on the robotics team. Neither encountered a class in college (both are EEs) where they did not already know the programming language and tools. They both won the junior design contests in college and attribute their success to FIRST experience.

HTH
__________________
Fast, cheap or working - pick any two!
  #19   Spotlight this post!  
Unread 03-06-2012, 02:20 PM
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Advantages of each programming language

Quote:
Originally Posted by remulasce View Post
<Obligatory Python pitch>
Truths.
  #20   Spotlight this post!  
Unread 03-06-2012, 02:53 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Advantages of each programming language

Quote:
Originally Posted by ianonavy View Post
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.
I can't address Java, but I do have experience with C++.

Thanks to ucpp, you no longer need a Windows PC for any part of the toolchain. If you can get a new gcc and libstdc++ (I've had issues with the cross compile for the latter :/) you don't even need to worry about memory management thanks to std::shared_ptr<T> and std::unique_ptr<T> if you don't want to.

C++ is also the anarchist's programming language. It gives you plenty of power, but also the ability to do not-so-good things with that power, and it doesn't try to stop you like Java (think pointer casts, crazy macros, abusive operator overloading, etc). In the hands of a good programmer, you can do amazing things in C++ incredibly succinctly and efficiently. In the hands of a bad programmer, C++ yields bug-ridden spaghetti code.

Lastly, you can also fall back to the raw VxWorks APIs in C++ if you want very, very easily.

Quote:
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.
I would say that for new programmers, LabView encourages some bad design practices. It makes it harder to define new functions (you have to make a new file, add terminals to that file, make a meaningful pixel art icon, etc. just to get a new function), the object orientation for the embedded target is incomplete (which forced us to use structs in C style OO), and those nice wires can quickly become mean when you have lots of connections and you can't tell what goes where. Yes, I'm biased I will say it DOES have the BEST parallel processing of any of the languages though.

Also, since it's not text based, it's not as friendly with version control.

Quote:
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.
Python is an AWESOME programming language. That said, those disadvantages are two HUGE disadvantages, so tread carefully.
Quote:
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.
+1: The biggest factor in determining which programming language to use is honestly the human factor. If the mentors and students on your team have the most experience with a given language, chances are that that's the best language to use regardless of the language's inherent strengths and weaknesses.
  #21   Spotlight this post!  
Unread 03-06-2012, 03:34 PM
abrightwell abrightwell is offline
Lead Software Engineer
FRC #0342 (Burning Magnetos)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Charleston, SC
Posts: 20
abrightwell is an unknown quantity at this point
Re: Advantages of each programming language

I agree with wireties, but I would have to argue that python deserves more credit than being a "specialized 4GL tool". Python is available on just about every platform and is increasingly becoming a must know language. Entire applications and frameworks have been built using python (Django and anything built with it is an excellent example), but it is also equally effective as a "automation" language to replace the typical unix based scripting. It is an incredibly dynamic and powerful language.

Speaking from the stand point of a software engineer/computer scientist, I agree with the statement of C/C++ or Java is better suited for those who are seeking such a degree. I also agree that they are similar enough to each other to negate any steep learning curve between the two. Java, in my opinion, is a bit easier to conceptually understand, however, as was stated it does have it's memory issues as well. It is very easy to accidentally hold on to a reference to an object thus keeping it from being garbage collected. Therefore, don't let the memory management aspect of C++ scare you away. Though, pointers tend to put the fear of God in some people.

A good computer scientist/software developer isn't going to constrain themselves to one language or even two. A healthy knowledge and proficiency in multiple languages is absolutely necessary. For instance, I use on a regular basis in my job the following languages: Java, C/C++, Python, Ruby, PHP, JavaScript, Scala, ActionScript and Objective-C. Sometimes, all in one day. They all have their pros and cons but each was selected for a very specific reason. Much like C/C++ is selected for most system level applications and Java is selected for most Web Applications. I like to look at it as layers of abstraction. At any rate, the point I want to make is that you should continue learning and exploring new languages and don't ever limit yourself.
  #22   Spotlight this post!  
Unread 03-06-2012, 03:56 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

Abrightwell says it well, I think. Python is an essential language in terms of its exceptional readability and simplicity. The performance and weak typing are valid criticisms in certain situations, but it is incredibly valuable for rapid prototyping of algorithms and even large pieces of software. Django is an excellent example; I was able to create a dynamic upcoming match display for our team in a few hours, that integrates with our scouting system.
  #23   Spotlight this post!  
Unread 03-06-2012, 04:10 PM
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
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...

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 reference unless you are a built-in type), memory leaks, C++ name mangling in compiler errors, initializing static class members outside of the class declaration, etc.
Nothing is ever passed by reference in Java.
__________________
Attending: MN Duluth Regional
  #24   Spotlight this post!  
Unread 03-06-2012, 04:20 PM
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

Quote:
Originally Posted by theprgramerdude View Post
Nothing is ever passed by reference in Java.
You are of course correct, editing the original post to avoid confusion...
  #25   Spotlight this post!  
Unread 03-06-2012, 04:24 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 rbmj View Post
Also, since it's not text based, it's not as friendly with version control.
Little biased here as my team is sponsored by GitHub but this is a huge con for me, version control is such a nice thing to have - especially working on a team with code that is changing constantly.
  #26   Spotlight this post!  
Unread 03-08-2012, 02:43 AM
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
Re: Advantages of each programming language

Thank you for all of the help!

Our programmer ended up using Labview, and so far it's working well enough
There are still a few minor bugs, but hopefully tomorrow we'll be able to get some assistance at the Portland regional.

Good luck everyone!
__________________
+ =
  #27   Spotlight this post!  
Unread 03-08-2012, 03:28 AM
jase728 jase728 is offline
Registered User
AKA: Jase728
FRC #3210 (Falcons)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Hillsboro
Posts: 11
jase728 is an unknown quantity at this point
Re: Advantages of each programming language

Honestly if you have never coded before start in Labview and use your off season to play around with c++/java
__________________
"In theory there is reality, but in reality there is no theory" - Erich Keane (FRC 2010 Build Season - Team 3210)
  #28   Spotlight this post!  
Unread 03-08-2012, 11:42 AM
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Advantages of each programming language

Frankly, one overlooked piece of this argument is the students.

If you have students who are interested in Computer Science/Engineering I would recommend C++ or Java, as the experience they gain will be quite valuable for them in the future.

C++ is a more complex language (but has some advantages), if you have a student who is willing to do the research to learn the in's and out's of memory management, references, pointers, etc. then it is a great opportunity to learn coding at a deeper level.

Java, on the other hand, can take away alot of the painful hurdles that a new programmer would encounter, making it easier to get the robot up and running, and makes a better gateway language than C++.

If you have students who are interested in pursuing non-computer related engineering and science, but are still getting stuck with the programming , then you should consider labview, as it is used much more frequently by non-programming oriented disciplines due to it's graphical nature, and ease of use.

Also take into account your mentors (if you have any that know programming), if you've got a mentor that knows any of the above, then it will take alot of the edge of learning that particular language.
  #29   Spotlight this post!  
Unread 03-08-2012, 01:03 PM
TimSchley's Avatar
TimSchley TimSchley is offline
Registered User
AKA: Tim Schley
FRC #0997 (Spartan Robotics)
Team Role: Mentor
 
Join Date: Aug 2011
Rookie Year: 2011
Location: United States
Posts: 24
TimSchley is an unknown quantity at this point
Re: Advantages of each programming language

Quote:
Originally Posted by jase728 View Post
Honestly if you have never coded before start in Labview and use your off season to play around with c++/java
I cannot stress enough how important I think it is to try to move from Labview to a text based language in your off season. Whether you move to java, c++, or python, it is going to be SO much more beneficial in the long run. Even if you don't go into CS, knowing how to use a text based language is so important in this world. They are so much more applicable in the real world. There is very little actual application to labview outside of robotics that a text based language would not be equivalent or better.

And honestly, learning Java is really not too difficult. There are tons and tons of tutorials out there, and using it in the scope of FIRST is a pretty easy transition. As a college freshman, I was fairly well able to teach 3 students Java from scratch, and bring one more up to date with FIRST java, within a few weeks. They now are doing all of the programming for our robot, and I couldnt be prouder of what they have accomplished in a few short weeks. Check em out at the Portland regional! Visit our pit! Team 997, Spartan Robotics.
  #30   Spotlight this post!  
Unread 03-08-2012, 01:24 PM
njg njg is offline
Registered User
AKA: Noah Gawlik
FRC #2856
Team Role: Mentor
 
Join Date: Sep 2010
Rookie Year: 2009
Location: Lexington, KY
Posts: 2
njg is an unknown quantity at this point
Re: Advantages of each programming language

One additional advantage of Java for FRC (compared to C++ or LabVIEW) is installation and activation. With only the getting started guide and an internet connection all of the Java tools can be installed and then used indefinitely.

In terms of students gaining programming experience, there is also some room for a team to use multiple languages. For example, this year we programmed our robot in Java and modified the dashboard application in LabVIEW. (Java can easily send data back to a dashboard written in LabVIEW despite the lack of examples)

As a professional engineer, when I interview job candidates I evaluate their ability to work through the logic of programming and weigh that far above their claimed experiences. Granted, we sometimes look for experience with a particular language but that's often secondary since syntax is far easier to teach than good programming/reasoning skills.
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