Results 1 to 5 of 5

Thread: C or C++

  1. #1

    Simbad54's Avatar
    Member Since
    Mar 04, 2007
    Location
    Amsterdam, Holland
    Posts
    388
    Specs:
    Mac Book Pro. 2.4Ghz Intel Core Duo running OSX 10.9.3, 8GB Ram
    C or C++
    Hi guys,

    I haven't been here for a LONG time!
    A quick question.
    I'm looking to start learning a programming language with an end goal of working with some simple robots. I'm less interested in writing apps, although that may become more interesting to me as time goes on.

    So, I get the impression that I should go with C rather than C++, but I'm not really sure of the differences.

    Can anyone point me in the right direction?

    Thanks in advance.

    Sim

  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    I would think it would depend on the robot frameworks. Is this something you are doing from scratch or are these robot kits with some documentation of the coding features? Really, you need to answer this question before moving forward on language selection.

    C++, Objective-C, etc tend to have extensive libraries today. Straight C is sparse in comparison. Using big libraries may cause you to require much more memory in your robots. Something I suspect would be limited resource.

    C++ adds in complication to gain it's object oriented features. Being new to programming, you might not want to jump into that extra difficulty.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  3. #3

    Simbad54's Avatar
    Member Since
    Mar 04, 2007
    Location
    Amsterdam, Holland
    Posts
    388
    Specs:
    Mac Book Pro. 2.4Ghz Intel Core Duo running OSX 10.9.3, 8GB Ram
    Thanks xstep for your reply.
    In answer to your question, I am looking to develop some very simply robots at a later date, probably from scratch.
    I have come across some systems, one in particular called brainstem, which is a ready to use control environment for a robot, and I believe it uses C.
    I don't know where this may lead, but I would like to not waste time learning a language that would end up being redundant at a later date, for my purposes.

    Thanks again.
    Sim

    I am right at the beginning of all this, and from what you say about extensive libraries, it would seem that C was a better option.
    Essentially, robotics is about controlling sensory and motor systems, so perhaps doesn't need a vast library.

  4. #4


    Member Since
    May 02, 2009
    Posts
    480
    Specs:
    MBP 2.33 4GB: MacPro 8 Core 2.8, 16GB: MacMini 2.26 4GB: MacMin 2.53 4GB: iPhone3GS 32GB
    In furtherance of xstep's point, you can never really go wrong with C. It's fairly easy to learn (in some respects) and quite a few other languages (Obj-C, C++, Java etc) all share syntactic similarities. While the spirit and idioms of these languages may be dramatically different, at the very least, the syntax won't be such a shock if you ever choose to move on to something different.

    Also, most low level code dealing with hardware typically is done in C: device drivers etc for the reasons xstep has already mentioned.

  5. #5

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    Quote Originally Posted by Simbad54 View Post
    Essentially, robotics is about controlling sensory and motor systems, so perhaps doesn't need a vast library.
    Likely any libraries you'll need will be available in the option you buy into. They also are likely to be efficient tight code. In fact, I'd say research this side of the issue. Some companies may have better developed systems than others.

    Look to see how well your companies of choice are supported by the outside world. This can make learning and getting detailed information easier. Also, does the company have use forums.

    Consider the open source community for support. Things you may want to do could have already been coded for you. Of course there are possible licensing issues with this option. The thing is, you could at lease look at the code to see how someone else thought to solve a problem.

    Sounds like a fun and challenging thing to get into.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •