Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   LabVIEW for C/C++/Java Programmers (http://www.chiefdelphi.com/forums/showthread.php?t=86026)

timothyb89 06-06-2010 06:20

LabVIEW for C/C++/Java Programmers
 
(Long build-up warning, the actual question is at the bottom!)

To start off, the programmers on our team have pretty solid "conventional" coding experience with C/C++/Java. Last year, when we first got our hands on the cRIO and dev tools, we initially sided with C++, but after some frustration, switched over to the LabVIEW environment hoping for smoother sailing.

After a couple weeks of tinkering with it, myself and the other programmer at the time found that we were never "really" able to wrap our heads around it, and the code we managed to produce certainly reflected that (we've successfully used it to scare people, including ourselves). When the competition finally came around, there was a quick rewrite of everything in C++ because it simply didn't work. Needless to say, we had better luck the second time around.

So... clearly we're bad LabVIEW coders :P. Still, I couldn't help but notice how many other teams (ie, the vast majority or FIRST) had little to no problems working with it. So my question is this: has anyone else had trouble "figuring out" LabVIEW when coming from a so-called "conventional" programming background?

(Side note: obviously, had we devoted the time necessary to truly understand it, this problem never would have existed. I'm just asking if others have had similar experiences)

Dkt01 06-06-2010 10:11

Re: LabVIEW for C/C++/Java Programmers
 
My experience shows that those who have programmed in conventional languages have trouble switching to LabVIEW. I, having done little coding in C++, learned most things for the first time in LabVIEW. This made everything pretty easy. A couple people on our team who had coded in C had trouble relearning how to do things in LabVIEW.

rsisk 06-06-2010 11:02

Re: LabVIEW for C/C++/Java Programmers
 
I certainly had a hard time moving from the languages I knew to Labview. But once you know how Labview works, it becomes natural to program in either language.

It really just takes a little time experimenting to become a Labview user

I think the big advantage of Labview is how quickly non-programmers can pick up the concepts

kgzak 06-06-2010 11:39

Re: LabVIEW for C/C++/Java Programmers
 
I had no problem programing in LabView, but I was just starting. 2009 was the first year I started programing, I was learning Visual Basic in school and picked up LabView at robotics. My dad picked up LabView fairly easy, and he has been programing for many years (he wants us to use machine code :p) I think the reason we picked it up so easily is because I was just starting and we learned together. I guess it all depends on your experience with LabView.

Tanner 06-06-2010 12:11

Re: LabVIEW for C/C++/Java Programmers
 
When we pre-ordered the new control system before the last season (lunacy) I spent about month learning LabVIEW. Didn't have any onsite mentors for it and I didn't read too much of anything in the idea of "how to do LabVIEW". It took a bit to first understand it, but once I got it, it was pretty simple.

-Tanner

Alan Anderson 06-06-2010 14:44

Re: LabVIEW for C/C++/Java Programmers
 
Quote:

Originally Posted by timothyb89 (Post 965549)
So my question is this: has anyone else had trouble "figuring out" LabVIEW when coming from a so-called "conventional" programming background?

The trouble comes when one insists on using that procedural-programming background instead of letting go and opening one's mind to the dataflow paradigm. It took me a couple of days to stop trying to apply what I "knew" about programming, but once I had accepted the way LabVIEW actually works it was smooth sailing.

It's a very Zen-like situation. The less you know, the more you learn. To learn faster, you must first forget the knowledge you already have.

Ether 06-06-2010 15:40

Re: LabVIEW for C/C++/Java Programmers
 
Quote:

Originally Posted by timothyb89 (Post 965549)
So my question is this: has anyone else had trouble "figuring out" LabVIEW when coming from a so-called "conventional" programming background?

With your permission Tim, could I expand the thread to ask if anyone who started out by learning LabVIEW as a first programming experience later had trouble learning C because they had trouble setting aside the dataflow paradigm? My son has never programmed before, and he is learning LabVIEW as a first experience. I am wondering what unique obstacles (if any) this may create when (if) he later tries to learn C.


~

timothyb89 06-06-2010 18:20

Re: LabVIEW for C/C++/Java Programmers
 
Quote:

Originally Posted by Ether (Post 965596)
With your permission Tim, could I expand the thread to ask if anyone who started out by learning LabVIEW as a first programming experience later had trouble learning C because they had trouble setting aside the dataflow paradigm? My son has never programmed before, and he is learning LabVIEW as a first experience. I am wondering what unique obstacles (if any) this may create when (if) he later tries to learn C.


~

No objections from me :).

The funny thing I found was that, after some LabVIEW experience with FLL, I didn't think figuring out the "new" FRC version would be much of a problem. I was sure wrong :P.

But... even from that "basic" experience I didn't really have issues learning different languages later on. I think having some experience bossing computers around really helped to that end, actually.

Greg McKaskle 06-06-2010 22:13

Re: LabVIEW for C/C++/Java Programmers
 
Let's say that you know base-ten numbers. You learn basic arithmetic, multiplication tables, decimals, fractions, all in base-ten. As far as you know, this is the only way to do math and you are on top of it. Go you.

Then a new teacher, say the CS teacher, decides to teach you base-eight numbers. It is weird. Many of the things you know about math are not necessarily correct. Everything is slow, you make many mistakes, and really just want to pretend this never existed.

Next the teacher brings up base-16, even weirder, and then base-2. Finally things start to click and you realize that there is nothing magic about base-ten, all of these are arbitrary, and there are benefits to knowing more than one system.

A similar analogy to Cartesian coordinate system versus spherical, versus cylindrical, ..., also fits. True, a language is more complex than a mathematical convention, but the point is that many times, the second way to solve a problem is more difficult to learn than the first. That doesn't mean that there was an issue with either of them, but it is simply human nature and is a natural process. Once you get over that hump, the benefits of knowing two mean three and four come far easier.

Greg McKaskle

Gdeaver 07-06-2010 09:52

Re: LabVIEW for C/C++/Java Programmers
 
The Key to Successful programming a robot in Labview is to understand the concept of data flow. Many of the text for Labview state that a procedural programming mindset can cause problems, but do not define or give very good examples of exactly what data flow means. There is an opportunity for some one to write a paper on data flow best practices. This would help the FRC community allot. Anyone up to the challenge? The next big thing that could help with the robot programming is a good tutorial on state machines. There are some good college level text on the subject but most students seam to have problems comprehending them. Another opportunity for a white paper. This year our robot code was much more complex than previous years. We had some serious control problems. As the the season progressed and the code evolved, it went from a procedural flavor to data flow and our problems resolved. This happened by experimentation not by design. The question is how to teach these concepts to new Labview programmers.

Ether 07-06-2010 10:04

Re: LabVIEW for C/C++/Java Programmers
 
Quote:

Originally Posted by Gdeaver (Post 965700)
The Key to Successful programming a robot in Labview is to understand the concept of data flow. Many of the text for Labview state that a procedural programming mindset can cause problems, but do not define or give very good examples of exactly what data flow means. There is an opportunity for some one to write a paper on data flow best practices. This would help the FRC community allot. Anyone up to the challenge? The next big thing that could help with the robot programming is a good tutorial on state machines. There are some good college level text on the subject but most students seam to have problems comprehending them. Another opportunity for a white paper. This year our robot code was much more complex than previous years. We had some serious control problems. As the the season progressed and the code evolved, it went from a procedural flavor to data flow and our problems resolved. This happened by experimentation not by design. The question is how to teach these concepts to new Labview programmers.

Wow, great post, you hit the nail on the head. The only thing I would add is a brief but usable explanation of the realtime and multitasking aspects of LabVIEW in the FRC context (LabVIEW FRC Framework). Or perhaps this could be integrated into the main topics you mentioned. From posts I have read this season and from personal experience, that was a big stumbling block for many new FRC LabVIEW users.


~

JamesBrown 07-06-2010 10:20

Re: LabVIEW for C/C++/Java Programmers
 
Quote:

Originally Posted by Alan Anderson (Post 965587)
The trouble comes when one insists on using that procedural-programming background instead of letting go and opening one's mind to the dataflow paradigm.

It's a very Zen-like situation. The less you know, the more you learn. To learn faster, you must first forget the knowledge you already have.


This is completely true. I took a course in programming languages, at first glance the class seemed simple, we had to learn the basics of different languages and write relatively simple programs. By this point in my Computer Science Curriculum I had little difficulty picking up languages.

The real test came when new paradigms were introduced. (Functional and Logic programming). You have to forget what you know about programming and start again, obviously it is still easier to learn than it was to learn your first language, however it is much harder than learning an additional language that follows the same paradigm.

Comparing it to learning spoken languages, Java to C++ is like French to Spanish, structure is the same, syntax is simmilar. Going from C++ to Labview is like French to German, the structure and approach are completely different.

When moving to a new programming paradigm, it is important to remember to apply the lessons you have learned about how to learn a language, not to apply the lessons about the actual language.

Robototes2412 07-06-2010 10:58

Re: LabVIEW for C/C++/Java Programmers
 
This might sound like an idiotic question, but is there a way to edit labview code with a text editor?

Alan Anderson 07-06-2010 11:21

Re: LabVIEW for C/C++/Java Programmers
 
Quote:

Originally Posted by Robototes2412 (Post 965710)
This might sound like an idiotic question, but is there a way to edit labview code with a text editor?

No, you can't edit LabVIEW code with a text editor. There is no underlying text representation to manipulate.

It might be possible to take the "directed graph" which defines a vi and produce a text report containing all its information, but one would need to invent a syntax for it, and making changes to that report and reversing the process would be extraordinarily error-prone.

demosthenes2k8 07-06-2010 18:06

Re: LabVIEW for C/C++/Java Programmers
 
Ugh...I've learned several text-based languages over the years, but switching to Labview was the hardest one to do. One of the mentors would tease me about how I wrote my labview code with random sequence blocks in it, simply because I wasn't used to having an environment do things for me like race conditions.

I only use it for the dashboard, but it's still taught me some things


All times are GMT -5. The time now is 03:44.

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