|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Why to use LV/C++/C?
Depends how fast you write (C/C++) and how fast you click, drag and type (Labview).
![]() But really, it all depends on how easier it is to you in think about the code in each IDE's enviorment (text-written or graphical presentation). Now that you mention the point of speed, it doesn't matter how fast you can create blocks or code, but what matters is how easy it is to find solutions to algorithim problems in each enviorment, because no matter how smart you are, most of the chances are that you will encouter bugs in your code (or the robot will respond unexpectidly) and you'll want to be able to figure out that problem using the best debuging tools out there. Last edited by Bomberofdoom : 07-09-2008 at 00:34. |
|
#2
|
||||
|
||||
|
Re: Why to use LV/C++/C?
Our team will be using C++ for all of the reasons that have been mentioned already. While I will admit I haven't worked with LabVIEW, I personally prefer writing raw code as opposed to designing a program using a graphical interface. I have also already created some data structure classes in C++ that I hope to implement this year. Our code team is also fairly well-versed in C++ and I look forward to showing it to the new members of the code team.
|
|
#3
|
|||
|
|||
|
Re: Why to use LV/C++/C?
There are so many ways to do the comparison. Years ago I read a book on comparing languages, and I thought their system was a pretty good one.
My disclaimer -- I work for NI, on LV. That means I'm a C/C++ programmer, and I also program in LV. My opinion is that they both have their strengths, and that is as it should be. In Atlanta, the question came up, "What is the most important language for the kids to learn?" There are many answers this, but my favorite answer is that the most important computer language for you to learn is your second one. Learning a language gives you a logic tool. You begin to look at problems from the perspective of that tool. It is the "If you are holding a hammer, everything looks like a nail" psychology. Learning a second language, especially one that is considerably different, results in having a second perspective, and learning the tradeoffs and interplay. Hopefully the second language also opens the eyes to the possibility of other language features, perhaps ones that haven't even been invented yet. To keep with my analogy, learning about other fasteners such as screws, bolts, clips, adhesives, etc. really gets started once you change your point of view and realize that the hammer and nail, while they are amazing, aren't the only tools in the modern toolbox. The book on comparing programming languages was "Comparative Programming Languages" by Wilson and Clark. No, it doesn't cover LV, but it does break down the elements that they think are most useful to measure when looking at languages for a comparison. It is also useful to see the different ideas that languages implement, and to watch that change over time. Inspired by their categorization, I normally condense this to, Expressive Power, Simplicity & Orthogonality, Implementation, Error Detection & Correction, Correctness and Standards. If I were to go into each of these for both LV and C, it would be a mega-post, and besides, I think it is better for people to do it on their own and come to their own conclusions. As an example, C++ scores better on expressive power than C does. Why? They both have the ability for the user to declare new functions, new variables, and even new types. But C++ goes further to allow for operators like + and - to be expanded for new types, and allows for the -> to be used to dispatch to class member functions. C++ also has additional keywords. This power comes at a price, however, as the sorts of errors you can receive from the compiler go way up, and the overall simplicity goes down. Finally, while most new users initially focus on the text versus graphics difference, this is pretty superficial. There could be a graphics C. Arguably you've already seen that. There could be a textual LV, but defining parallel graphs in text is fundamentally hard and we have instead headed down the graphics road. A more fundamental difference is that C/C++ are procedural languages or imperative languages whereas LV is mostly a functional language. These terms may not mean much, but they are the more important ones to look up and think about. I don't have a great analogy, but that won't stop me from trying one anyway. An imperative language to me is like driving a vehicle with a manual transmission. There are discrete gears, combined in various ratios to direct the engine rotation to the wheels. You control this with a clutch, a shifter, possibly more if in a semi or farm equipment where I can control other differentials. Fundamentally I'm exposed to the implementation and am expected to manipulate the system at that level. Not all settings make sense, and grinding of gears, getting stuck in neutral, and stalling the engine are all common occurrences, especially until you learn the system quite well. But once you understand the system, it is quite powerful and adaptable. A functional language in this analogy is more like an automatic transmission system. Fundamentally the big difference is that the driver specifies what the outcome should be, but not the intermediate details. It may be as simple as F-N-R and a pedal. You still control the velocity of the vehicle, but you have traded control for simplicity. When you inspect the automatic transmission system you may find that it is really a manual with an automated shifter, or you may find a CVT or hydrostatic where it isn't even easy to compare them any longer. A CVT isn't limited to a small number of gear combinations, so is it better than a limited manual transmission? Or is it inferior because of the limits on the amount of power it can transfer? Different approaches to the same problem. Isn't it better to focus on understanding both than to be dogmatic about it? Greg McKaskle |
|
#4
|
||||
|
||||
|
Quote:
Quote:
Quote:
Quote:
). I would also like to take the chance to look at LV though to see how it works and what advantages it has, even though our team will be coding in C++ this year.Last edited by slavik262 : 07-09-2008 at 20:42. |
|
#5
|
|||||
|
|||||
|
Re: Why to use LV/C++/C?
(C/C++ is procedural, LV is functional)
You should probably look up what "functional programming" means (try Wikipedia). Being Object-Oriented doesn't appreciably change C++'s imperative nature. What you've written seems similar to "While an orange is a fruit, a navel orange is seedless." |
|
#6
|
||||
|
||||
|
Re: Why to use LV/C++/C?
Quote:
|
|
#7
|
|||||
|
|||||
|
Re: Why to use LV/C++/C?
There is, we call it "Easy C".
![]() |
|
#8
|
||||
|
||||
|
Re: Why to use LV/C++/C?
Will there be an EasyC option next year?
|
|
#9
|
|||
|
|||
|
Re: Why to use LV/C++/C?
Our team has lost all the programers to graduation. The returning group wants no part of programming. The are several 9th graders who have experience with the lego platform. If they join the team it will be interesting to see how thier use of NXT-G aids them in the programming of the FRC in lab view.
|
|
#10
|
||||
|
||||
|
Re: Why to use LV/C++/C?
I may be sounding like one of the "older" mentors on this board (perhaps I am? lol, no), but my first programming language I learned was Fortran 90/95. My second was ANSI C. Now when I first started work, I was fairly proficient in either language (really, both languages are good because knowing them, mostly Fortran, is a lost art). However, most of our programs are programmed in LabVIEW. A fundamental difference between these languages is that Fortran and C are "top-down" programming, whereas LabVIEW is a "data-flow" programming language. I do know one thing, LabVIEW does things MUCH easier and faster than C or Fortran (programming wise). For example, you have absolutely no pointers, no worry of memory allocation or anything. It is much easier to use, but it can be quite difficult making the transition for your brain to think in data-flow vs. top-down.
|
|
#11
|
|||||
|
|||||
|
Re: Why to use LV/C++/C?
Quote:
I look forward with a mix of anticipation and dread to actually having this stuff in front of me to work with. My optimistic expectation is that I'll quickly realize what simple concept is keeping me from completely understanding what I'm reading, and that I'll finally "get it". (My nagging fear is that I'm a programming dinosaur, stuck in a procedural tar pit and doomed to extinction as the dataflow mammals take over.) |
|
#12
|
||||
|
||||
|
Re: Why to use LV/C++/C?
Quote:
Your written thoughts created an incredible visual. Last edited by JaneYoung : 09-09-2008 at 12:37. |
|
#13
|
||||
|
||||
|
Re: Why to use LV/C++/C?
Quote:
|
|
#14
|
||||
|
||||
|
Re: Why to use LV/C++/C?
Quote:
). I realize that LV may provide faster development, but doesn't C++ provide you with slightly finer control? |
|
#15
|
|||
|
|||
|
Re: Why to use LV/C++/C?
Quote:
I will defer to Greg as to whether or not Michael's assertion is true 100% of the time, forever and ever. I simply don't know. What I do know is that typical LabVIEW code reminds me of LISP/Scheme in how it handles basic data types. The Liopleurodons among us may benefit of approaching it from that angle - that was the mental leap that made everything "click" for me. Now I think of LabVIEW as Graphical PythonLISP. To over generalize: Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why Not Use ISM band? | Mr-Shutter | Control System | 8 | 06-06-2007 21:03 |
| Why you should use Gmail | Nathan | Chit-Chat | 5 | 22-02-2007 00:20 |
| Why use the RC to control Pan/Tilt | Joe Hershberger | Programming | 15 | 30-01-2007 23:41 |
| Why would you use FIRSTwiki? | Max Lobovsky | FIRSTwiki | 4 | 18-07-2004 23:59 |
| Why can't you use 255 in PWM? | Andrew | Technical Discussion | 4 | 29-05-2003 14:50 |