Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Starting programming... (http://www.chiefdelphi.com/forums/showthread.php?t=85861)

kenavt 20-05-2010 21:20

Re: Starting programming...
 
Quote:

Originally Posted by Greg McKaskle (Post 963153)
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

This sounds like a great site. Thanks a lot! It seems like a lot of the programming on the robot is numerical-related, I can see that could help me a lot.

Quote:

Originally Posted by Chris27 (Post 963160)
Which is easily less than 1% of what there is to know about C++. Besides most of what you know now will transfer over to Java as C,C++, and Java share similar syntax. I'm just telling you from experience that C++ can quickly become a world of hurt.

I don't understand what you mean by that.

davidthefat 20-05-2010 21:22

Re: Starting programming...
 
Quote:

Originally Posted by kgzak (Post 963163)
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.

Here is what I don't get, once you learn C++ why would you want to move to LabView? :confused: Makes 0% sense to me... Its like getting a Lambo then trading it for a Civic in my view... If you understand, why restrict yourself while you have almost full control with C++ then putting on training wheels?

Chris27 20-05-2010 21:24

Re: Starting programming...
 
Quote:

Originally Posted by kenavt (Post 963165)
I don't understand what you mean by that.

I'm saying you won't have a head start in learning C++ over Java given that you know how to use if statements.

kgzak 20-05-2010 21:32

Re: Starting programming...
 
Quote:

Originally Posted by davidthefat (Post 963166)
Here is what I don't get, once you learn C++ why would you want to move to LabView? :confused: Makes 0% sense to me... Its like getting a Lambo then trading it for a Civic in my view... If you understand, why restrict yourself while you have almost full control with C++ then putting on training wheels?

If that is what the team uses then I would learn it. Would you rather have a group of guys that can program in LabView or have one guy that can program in C++. I also don't see why C++ is any more powerful than LabView. I have written code more advanced than what one of our mentors did in C++ with LabView. I will say LabView is a little...silly? but I do the like how easy it is to debug and get live feedback. My question is why not learn both?

kenavt 20-05-2010 21:32

Re: Starting programming...
 
Quote:

Originally Posted by Chris27 (Post 963167)
I'm saying you won't have a head start in learning C++ over Java given that you know how to use if statements.

OK, well, thanks. However, I find that C++ is more widely used and would be more worthwhile. However, a "world of hurt" sounds like a good problem to solve!

Quote:

Originally Posted by kgzak (Post 963163)
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.

Yep, that's what I'm thinking.

Chris Hibner 20-05-2010 22:21

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.

Greg McKaskle 20-05-2010 22:37

Re: Starting programming...
 
Quote:

Here is what I don't get, ...
Even though I helped write LV, I don't feel the need to defend it. Results speak for themselves.

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

Alan Anderson 20-05-2010 22:37

Re: Starting programming...
 
Quote:

Originally Posted by davidthefat (Post 963166)
Here is what I don't get, once you learn C++ why would you want to move to LabView? :confused: Makes 0% sense to me... Its like getting a Lambo then trading it for a Civic in my view... If you understand, why restrict yourself while you have almost full control with C++ then putting on training wheels?

I think -- I hope -- that you're confusing LabVIEW with EasyC.

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

davidthefat 20-05-2010 22:41

Re: Starting programming...
 
Quote:

Originally Posted by Alan Anderson (Post 963187)
Actually, I'm inclined to liken C to a 1950'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

:ahh: Like the ones used by the marines in WW2, I like that analogy;)

Radical Pi 21-05-2010 00:20

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.

Ian Curtis 21-05-2010 01:38

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.)!

mwtidd 21-05-2010 10:30

Re: Starting programming...
 
Quote:

Originally Posted by kenavt (Post 963170)
OK, well, thanks. However, I find that C++ is more widely used and would be more worthwhile. However, a "world of hurt" sounds like a good problem to solve!.

"world of hurt" is a miserable problem to solve. Maybe its just because low level programming is not my particular skill set, but my C (C++) class took me about 50-60 hours a week alone. I passed the class by the grace of god and ironically with a C. Why may you ask, because of the "world of hurt". Debugging in both C and C++ is very time intensive.

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 :)

Andrew Schreiber 21-05-2010 10:57

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:

Originally Posted by davidthefat (Post 963166)
Here is what I don't get, once you learn C++ why would you want to move to LabView? :confused: Makes 0% sense to me... Its like getting a Lambo then trading it for a Civic in my view... If you understand, why restrict yourself while you have almost full control with C++ then putting on training wheels?

You clearly know nothing about owning a vehicle. A person gets a Lambo to be flashy and fast. A person gets a Civic to be practical. I know during Michigan winters I would trade a Lambo for a Civic in a heartbeat. I would be spending more to repair the Lambo after it slid sideways into a pole anyway. It is all about using the right tool for the job. For some jobs it is C++, for others LV.

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:

Originally Posted by davidthefat (Post 963149)
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

You keep mentioning your failing in a bunch of threads almost as if you are proud that you had the stupid thought that you could slack off and not care. I'm not sure I really want someone who is proud of failing a class giving my students advice.

JamesBrown 21-05-2010 11:09

Re: Starting programming...
 
Quote:

Originally Posted by davidthefat (Post 963166)
Here is what I don't get, once you learn C++ why would you want to move to LabView? :confused: Makes 0% sense to me... Its like getting a Lambo then trading it for a Civic in my view... If you understand, why restrict yourself while you have almost full control with C++ then putting on training wheels?

When I see posts like this it is always painfully obvious that the poster has not used LabView, and has certainly not actually tried creating the same program in LabView and C++ or Java and seen which one takes longer.

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:

Originally Posted by Andrew Schreiber (Post 963253)
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.

I am still waiting for the day I find a problem that requires me to use Haskell, I had to learn it for a class and am yet to find a situation to apply that knowledge (ProLog falls into this category too).

rsisk 21-05-2010 11:20

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:
  • Sequential code
  • Subroutine
  • GoTo or Jump
  • If-then-else
  • Case
  • Do While-Do Until

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.


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