go_away

Author Topic: C,C++,C# which one?  (Read 1461 times)

0 Members and 1 Guest are viewing this topic.

Offline huffdevTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
C,C++,C# which one?
« on: December 19, 2010, 03:02:10 AM »
Idk where to start which programming language in c I understand you can do VPL And motion programming but i still want to learn one of those programming languages so i can use those to.

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: C,C++,C# which one?
« Reply #1 on: December 19, 2010, 03:41:11 AM »
For robots, learn C first.  For OOP, learn C++ (and if you don't know what OOP is, learn C).  Unless you have to, don't use C#.  (The last is a personal opinion).

Offline ballbreaker

  • Full Member
  • ***
  • Posts: 78
  • Helpful? 1
Re: C,C++,C# which one?
« Reply #2 on: December 19, 2010, 04:29:07 AM »
start with c go to c++ then java and c# if you want to expand your programing skills
For Those About To Rock, We Salute You!

Offline huffdevTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: C,C++,C# which one?
« Reply #3 on: December 19, 2010, 04:33:11 AM »
thanks guys!

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: C,C++,C# which one?
« Reply #4 on: December 19, 2010, 05:10:31 AM »
yup. i would agree.
C is the parent language.
you will find a C compiler for just about any processor on the market.
C is your best starting point.

C++ is an extension of C so anything you learn from C will be directly usable if you ever go on to C++.
a C++ compiler will compile C code so if you can program C you will feel fairly at home using a C++ compiler. (there are some small changes in the standard but the code should still compile with some warnings.)
full C++ implementations are not as common on small embedded platforms as C.
many of the extensions that C++ brings are to do with complex data structures which are typically not required on CPUs with a very small amount of memory.

C# started life as a vendor specific (microsoft) implementation of C++ so C is again the obvious starting point.
you will not find a C# implementation for many of the CPUs in use in robotics.
there are a few C# embedded implementations but they tend to be more expensive and less efficient as C# was never conceived with memory efficiency in mind.
that being said, C# is a good platform for full computers where memory and CPU constraints are not such an issue.


in my opinion which language is not that important when you are first starting out.
more important is picking a whole development environment that has good support with lots of online examples.
good libraries (pre-written code sections) for your choice will greatly speed up the development time of your projects.

if you want a versatile place to start then look into the GCC AVR port. this involves C programing on the Atmel AVR but as you are using GCC your knowledge will be portable to 1000s of different platforms (including PCs).
this website's "50$ robot" project is a good place to start.

if you want an easy place to start, look into the Arduino platform.
it's programming environment is based on C but they hold you hand through the hard parts and provide you with a ready to go platform at the expense of being tied to limited hardware.


dunk.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: C,C++,C# which one?
« Reply #5 on: December 19, 2010, 08:46:42 AM »
I am in agreement with all the above posts. Learn C first.
Also the best book and well worth the price is:
The C Programming Language by Brian Kernighan and Dennis Ritchie.
http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)
http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628

 


Get Your Ad Here