![]() |
Starting programming...
Over the past couple of years, I have really been interested in getting started with programming, but I was usually too busy with some other extracurricular activities or school. Then, this year, I joined my school's FRC team, and I am really into robotics. This year, I was in charge of the layout and execution of the wiring on the robot. Next year, I want to help program.
With this goal in mind, I was wondering: what do you think would be the best way to get started into programming in general? I have had minor, minor experienced with C++* and a little bit more with LabVIEW** (which is what we use). However, I really want to take part of this summer to really get my fingers into programming, with the intent of being a help on the programming side to the team next year. I don't really know where to start. I've looked through some of the official FRC documentation on LabVIEW, and that's about it. I'm sure you guys get asked this question a lot, so what should I do to start out? *Wrote a program to randomly generate an integer using randl;, then user guesses the number and the program outputs how close you are (within 5, 10, 20, or outside 20). **Wrote same program as above except using LEDs and indicators in LabVIEW, plus I hung out with our main programmer as much as possible so I picked up a couple of things. |
Re: Starting programming...
I have a suggestion, go learn C++ from books, thats how I did it, and I ended up fine. May be they don't teach you how to program, but they teach you the basics. You just need to practice, practice programming text based games or something. Robots are different, I had trouble in the beginning with robots, since its different mindset, but just learn to program. Programming is how you think, not code on the computer screen. If you understand what I mean. The syntax is not the programming part, but the logic.
|
Re: Starting programming...
Quote:
|
Re: Starting programming...
Along with what davidthefat said, maybe your coach/mentor will give you a copy of LabView so you can play with that at home. Thinking like a programer might be the hardest part. I picked up on LabView, and other languages, very easily because I already thought like a programer, I just didn't know it. Have your programer show you some code and explain what it does and soon after you understand how that works try to decode some code without having the programer explain it. I worked with one of you programers at Kettering when we had issues with our watchdog, he knew a lot about LabView and he would be a good person to talk to. How did he pick up LabView?
|
Re: Starting programming...
Quote:
I'll definitely try trying to figure out code, probably from the examples included with LabVIEW (I can't have access to the competition code we used right away). The real thing I want to do is learn more about "real" programming - CLI - than transition over to LabVIEW. I also have a question: Would it be better to learn C first, or C++? C is a good basic language, I hear, but C++ is more commonly used. |
Re: Starting programming...
I'd recommend against learning C++ as your first language. You should start with Java as you will encounter much fewer headaches and debugging code is a lot easier.
|
Re: Starting programming...
Quote:
edit: LOL at what Chris said, thats why I have an F in my AP Computer Class, it was so easy that I just slacked off... BAD IDEA... well good thing there is a project thats 70% of my grade, and its about the autonomous robot challenge |
Re: Starting programming...
I learned VB a long time ago. Thats why I didn't do any software stuff for a few years afterwards.
Then I learned C++ basics, like functions, variables, and cout/cin. Then I joined my middle school's FLL team my 8th grade year. I quickly learned Mindstorms and actually hit the maximum potential of the language (that is not hard to do in Mindstorms). It was fun, and prepared me to think like a programmer more then I did previously. Freshman year on the Killer Bees, I learned LabVIEW, and although my code actually looked like spaghetti and had many issues, and was poorly organized, it worked. I wrote the crab steering code on our 09 robot, and it was later integrated into the rest of the code written by Jim (and probably re-written, I don't actually know what the final code looked like). This year I made a much larger effort to organize my code, I wrote some software in the off-season to simulate arms and crab steering, and was the software lead (well, the only programmer). Being a fairly high-level programmer, I was more interested in the algorithms, logic, and design of the code then the implementation. I am still good at writing it, but spend some time before writing it on organization and partitioning modules. I actually never used C for anything useful until 2009 OCCRA, on the VEX processor in Microchip C. And I learned a lot more then I want to know about pointers on that little VEX processor. It depends on if you prefer higher level or lower level programming. If you already think like a programmer and focus on the logic, not the implementation, then LabVIEW is probably for you. If you prefer writing syntax and debugging lines of code, then C++ is probably best (better start with C-like code that dosen't use pointers or classes first, then work up to classes/namespaces and pointers). |
Re: Starting programming...
Quote:
|
Re: Starting programming...
Perhaps a year ago, someone mentioned the Project Euler site. This is similar to how I learned to program. Pick a language and take a crack at a few problems. Once you have your bearings, may I suggest trying one of the other languages, and perhaps even the third. Given a problem to apply your programming to, try out different tools -- video tutorials, written tutorials, examples, reference books, etc.
If math isn't your thing, obviously there are other good ways to learn how to program, but coming to grips with what is commonly referred to as scientific programming, or numerical programming is, I think, similar to much of what you'll see on the robot. Of course the robot will introduce you to many other concepts as well, but if you are good at the numerical stuff, I think you'll find the rest easy to pick up. Greg McKaskle |
Re: Starting programming...
Quote:
|
Re: Starting programming...
Quote:
Quote:
|
Re: Starting programming...
Quote:
|
Re: Starting programming...
Quote:
|
Re: Starting programming...
Last year is when I started programing. I had never done any programing before that and our entire robot was programed by me last year. I learned Visual Basic at school and LabView at robotics that was as much knowledge I knew about programing. I would take all my robotics work home with me. That is how I learned. I think I learned as being a last resort but in the end found out I enjoyed it. So, I don't think it matter what language you learn first as long as you learn the basics of programing. I would suggest learning more about C++ if you feel you have a little knowledge about that. It may lead you into LabView.
|
Re: Starting programming...
Quote:
Quote:
|
Re: Starting programming...
Quote:
|
Re: Starting programming...
Quote:
|
Re: Starting programming...
Quote:
|
Re: Starting programming...
Quote:
Quote:
|
Re: Starting programming...
Whatever language you decide to learn first, I hope you enjoy the adventure. Learning programming will change your view of the world.
There is a fairly significant difference between object oriented programming and structured procedural programming. I would recommend learning each style fairly early on so you don't get too set in your ways before learning the other style (your head might explode otherwise). Object oriented and structured procedural each have their own place in the world and I don't see either of them dying in the near future. Good luck. |
Re: Starting programming...
Quote:
Do carpenters sit around arguing about things such as ... "I hate nails -- primitive noisy hammering -- I will never use anything but screws in my construction. " "All that twisting, how inefficient. A few taps and I'm done." "Hrumph! Both of you. Neither of them works well with stone, and everyone knows..." Perhaps they do, but for some reason it seems to be more prevalent with people who call themselves programmers. Languages come and go. Of the dozen or so languages I learned in and before college, only one of them still gets a bit of occasional use. Meanwhile, the concepts, the analytical problem solving skills, and perhaps most importantly, the ability to communicate with others about problems and solutions are the things that are still quite useful. The best way to start programming is to start and never stop. Greg McKaskle |
Re: Starting programming...
Quote:
If you're comparing programming languages to vehicles, with C++ as a high-speed sports car, LabVIEW might be more like a helicopter. It's an entirely different kind of programming from a procedural language like C++ or Java, but it's just as powerful. Actually, I'm inclined to liken C to a 1940's-era Jeep, designed to be small and nimble and capable of going off-road...but completely devoid of niceties like airbags and anti-lock brakes. :-P |
Re: Starting programming...
Quote:
|
Re: Starting programming...
If you're just getting started with C(++), I'd reccommend learning C first. I personally think it is much simpler than C++ in terms of language constructs (not as much when you get into actual implementation) and I personally think it's better in getting you to "think like a programmer" as other people have said in this thread. Last week I was helping a friend learn Objective-C and because of the way the APIs are written (this was for iPhone) you can't really do anything without jumping directly into the object system in the language. The parts he was really having trouble with were the ones that OO languages make more complex (pointers, typecasting, objects (as opposed to structs), etc.), and would have been much easier for me to explain in plain C.
On the topic of LabVIEW, again I feel like it is a "programmer mindset" thing. With the closest thing to LV experience being NXT-G (which for those of you who haven't used it is MUCH more procedural than real LV), I was able to pick up the classmate and mess with the dashboard within 2 days, the majority of that time being the rewrite of the robot side dashboard sender (C++). Again, Having that prior experience programming really helps in switching out languages. Oh and no matter what language you are learning, books and tutorials can only go so far. Real understanding of the language comes from looking at examples and analyzing every single line (or block) of code in it, knowing exactly how it works and what is happening in that line. That's where the "programmer's mindset" comes from. Not knowing to type in this line here, but knowing why typing this line here does what it does. |
Re: Starting programming...
While finding prime numbers isn't particularly useful for driving robots, it is coding experience! As Greg mentioned, Project Euler gets you writing code to solve problems, and rewards your effort with little check marks. :D
Once you've solved them once, it's fun to go back and solve them in other ways too (MATLAB, Excel, Python, C, using an Arduino, etc.)! |
Re: Starting programming...
Quote:
Also remember that as you are in a FIRST thread you will see a particular bias. FIRST has an attraction to engineers, which computer science and programming stems far away from just engineering in the FIRST sense. Many developers working with hardware like to get as close to it as they can, hence why you see a lean towards C++ in this community. Also this year is the first year FIRST officially supported java, last year the first for c++, before that it was C, and before that it was basic. your statement about it being more widely used is definitely true for FIRST right now, but not necessarily true as a general comment. Also I think that c++ is more widely used simply because it was the only alternative to labview last year. Many teams don't want to make the transition to java, as they have already invested in c++. I am not going to tell you what language you should start with, I am just saying that realize that many of the comments you see here will be biased, including my own :) |
Re: Starting programming...
Canada, 2337 will be running some training for programmers over the summer. I've just been busy with work and haven't worked it out with Clinton. As far as what you can do to get a jump on it. If you want to learn C++ there are a handful of books out there (check your local library). For Labview there are a series of tutorials available online. For Java, I'm not sure what resources exist but I have a handful of Java books I could loan you if you can't find anything. As far as I am concerned I will use whatever language the students want to use. At any rate, you can't go wrong with whatever language you pick. The thought process behind programming is the hard part. Run through Project Euler, finding primes has nothing to do with robots but it will teach you the syntax, it will teach you how to think through a problem too.
Good luck, have fun! Quote:
For example, I know C pretty well. I then proceeded to learn Labview, Python, Lisp, Haskell, Java, and C#. Why? Because I want to have a nice big tool chest for when I run into a problem. While I am thinking about it, David, prove to me that any one of these languages is more or less powerful than the rest. Then I will take your claims that C++ is better than LV seriously. Quote:
|
Re: Starting programming...
Quote:
I learned C and C++ long before I started looking into LabView. I was pretty much forced into learning LabView (up until this point I thought that graphical programming was for people who couldn't handle learning real languages) when the "LabView Guy" in our lab graduated. I inherited his projects and started learning LV, after a couple of weeks I was capable of trouble shooting his software, by the end of the summer I was fairly proficient using LV. I can write code in a fraction the time it would take me in your choice of text based languages. I don't have to worry about a lot of things like parsing serial data because the tools are there for you. My favorite thing about LabView is that after the code is working with a few clicks I can create a pretty good looking GUI with graphs and charts that clearly show what is going on (try explaining to marketers and sales people that numbers in a terminal window are proof everything works. In my current job I don't get to use LabView very often (4 bit micro controllers that cost <$.02 don't really run LabView code). I spend my day writing in C and Assembly (and all sorts of proprietary interpretations of C). I have all the control in the world over my micro controllers, however I would not equate the experience of going from LabView Back to C to going from a Civic back to a Sports Car. C (or C++) may be fast and efficient but it is not a Lamborghini, it is more like a stripped down race car, built for performance, it may perform better but it is uncomfortable to drive, labview on the other hand would be your Luxury performance car, it might not be as efficient as a sports car but it is much faster than 99% of drivers will ever need it to be, and all of the luxuries and conveniences greatly out weigh the marginal performance increases. Quote:
|
Re: Starting programming...
Learning a particular programming language is no where near as important as learning the basics of programming.
For example, learn some of the basic programming structures like:
Learn how to define a problem through reiterative decomposition, a fancy way of saying: break down a problem into smaller components until you can solve it Learn good programming practices like code reuse, code refactoring, encapsulation. There is a lot of good practices in the object oriented realm to help you write good reusable code. Know your problem domain. If you are writing code for robots, you need to know different things than if you are writing code for an accounting system. I have yet to use the concept of debits and credits when writing for our robot, and never once needed to filter the noise out of a potentiometer for a AR Aging report ;> So focus more on the fundamentals of programming, after that, picking a language is usually driven by the environment you are working in, or what you have available at the time. But if you know the fundamentals, it doesn't really matter much which language you end up in. |
Re: Starting programming...
Quote:
Quote:
Quote:
Just a quick question: What is the difference between high-level and low-level languages? Thanks! |
Re: Starting programming...
Quote:
|
Re: Starting programming...
Quote:
|
Re: Starting programming...
Quote:
|
Re: Starting programming...
Quote:
Most of the times a jump is needed is already dealt with by the compiler, such as in Try/Catch blocks, subroutine returns, jump tables, etc. In these cases, the compiler will generate a jump instruction in the low level language to perform a high level function. Using a GoTo in your code tends to indicate poor coding and sloppiness. If you find you need one, review your code and try to find a better way to code it. |
Re: Starting programming...
Quote:
The distinction I wish to make is between programming and coding. Programming involves analysis of the problem and design of a solution, including the algorithms and data structures used in the design. Coding merely implements a solution on a specific target. There can be valid reasons for including unconditional jump instructions in an particular implementation, but I do not think they are ever warranted in a program's design. |
Re: Starting programming...
Quote:
~ |
| All times are GMT -5. The time now is 23:20. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi