Go to Post This exercise in thanking the hand that teaches you brought to you by the Unsung FIRST Heroes Award. Have you thanked your mentor lately? - Amanda Morrison [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #21   Spotlight this post!  
Unread 06-03-2012, 14:53
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.
 


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 01:22.

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