Shop OBEX P1 Docs P2 Docs Learn Events
Programming Languages — Parallax Forums

Programming Languages

Dylan LandryDylan Landry Posts: 235
edited 2010-08-24 15:39 in Robotics
I am sort of new to robotics, (only familiar with PBASIC) and I have a programming language question.
The Languages I have heard of are BASIC, PBASIC, C, EasyCpro, C+ and C++. If I am looking towards a career in robotics, which one will be the most valuable to learn? I do not know a lot about programming, just enough to get by actually, so if you could answer in simple terms it would be greatly appreciated. Also, if you could also answer this one, why do they keep on creating different languages? Why not just keep one, like in music, so it could be much easier and would pose less problems in the future?

Comments

  • Peter KG6LSEPeter KG6LSE Posts: 1,383
    edited 2010-08-23 15:04
    robotics . as In GE FANUC or as in Battle bots ?
  • LeonLeon Posts: 7,620
    edited 2010-08-23 15:32
    C is used in most professional applications, including robotics.
  • Martin_HMartin_H Posts: 4,051
    edited 2010-08-23 18:41
    We have robotics companies in the Boston area and they sometimes have employment ads on the T. They tend to list C/C++ and Java as languages they require experience in. So I would suggest C as it is the simpler of the three languages, and they share a common syntax as C is the parent language.

    You know PBASIC and will understand control structures like loops and conditionals. But PBASIC doesn't have structures, pointers, or true functions which will likely confuse you at first. Eventually you might want to learn assembler, not because you'll use it (although you might), but because you won't fully understand computers until you know it.

    Why people create more languages is complicated. Sometimes it is to push the field of computers farther because old languages are missing a key feature the new language introduces (Smalltalk and object oriented programming, or LISP and functional programming). Other times the designer is really creating a toy for entertainment. Finally, some languages are intellectual property of one company. If another company creates a competing product, they need to create a new language to compete.
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-08-24 07:46
    I am sort of new to robotics, (only familiar with PBASIC) and I have a programming language question.
    The Languages I have heard of are BASIC, PBASIC, C, EasyCpro, C+ and C++. If I am looking towards a career in robotics, which one will be the most valuable to learn? I do not know a lot about programming, just enough to get by actually, so if you could answer in simple terms it would be greatly appreciated. Also, if you could also answer this one, why do they keep on creating different languages? Why not just keep one, like in music, so it could be much easier and would pose less problems in the future?
    Dylan, sometimes the most valuable language to know is the one that the job requires. But this changes like the weather. By the time you graduate, there will be new languages demanded. Imagine this true scenario. I know 80 computer programming languages. I walk into the robotics company to apply for a job. They want me to program in a language I never heard of. Amazing! To make a long story short, I got the job and wrote a front end program in three embedded languages which was unique at that time. I never used the little unknown language very much.

    There was a short time in history where the predominant language "thread" was Dartmouth BASIC and all of its versions that followed. It was amazing because the language was constantly improved. You could choose a simplistic TINY BASIC made popular by Tom Pittman, or an advanced BASIC version called Extended BASIC Level II with advanced String handling. What specialized routines that did not exist in Extended, were simply written as subroutines by thousands of programmers. You could find a fast Shell Sort or various algorithms among a selection of thousands.

    http://en.wikipedia.org/wiki/Dartmouth_BASIC

    I too wish the car manufacturing companies would choose one model and stay with it, improving it year after year. But there's many selections of cars to suit many purposes too. We have 160 programming languages for the Propeller chip so far and the list will continue to grow. One for every purpose and some for all. I would think, starting out again, to learn three languages. The type of language will depend on the field you select. BASIC is a good 1st language. A version of C is good. And a language for parallel/clustered processing programming will be very useful coming up in the near future.

    Humanoido
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-24 08:10
    It's much more important to learn programming concepts than languages. As others have mentioned, there are always new languages and what's necessary for a particular project may be completely different from what you use for other projects.

    C is a good choice for some projects and familiarity with it may be a requirement for some jobs. C++ is another good choice. Objective-C is important for things like the iPhone and the MacOS. For robotics, LISP is often used. The various scripting languages like Perl, Python, Ruby, etc. are also important to learn. If you do much web-based stuff, you'll need to learn JavaScript. Basic is still used for major projects. Occasionally you'll find Pascal used.

    Start with one programming language. Learn about data structures ... arrays, trees, lists. Learn about arithmetic ... multiplication, division, transcendental functions. Learn about I/O ... conversions, buffering, file systems. Most desktop programming languages take care of these things for you ... you have to learn what they're doing inside. You don't have to be expert about it, but you do need to understand your tools and how they work.

    To answer your other question ... why invent new ones? ...

    Programming languages reflect how we think about problems and they also reflect the tools we invent to implement the solutions (like newer, more complex, faster chips). There are many different kinds of problems and we come up with different ways of expressing the solutions. For example, SNOBOL was developed to express solutions to problems about manipulating string of characters with complex patterns within them. It's very good at that. LISP was developed to express complex theorem proving solutions and became a major tool for artificial intelligence research because it didn't distinguish between its own programs and other forms of data, thus a LISP program could generate a subroutine to manipulate something, then execute it.
  • Dylan LandryDylan Landry Posts: 235
    edited 2010-08-24 13:45
    Thanks to everyone that answered. I am looking forward to a career in robotics, so this will be very helpful. I have one more question. When I am looking at all the different company's, and their controller, do they all use only specified languages? I understand that the Propeller can use a large amount of languages, (I am uncertain how, maybe something like a drop down bar, which ever way it is in not important now), but with lets say the VEX micro controller it can use easyC, ROBOTC and MPLAB. Now this may be a very difficult question to answer. Within each micro controller and their downloadable software, how do you switch between the languages? Is it just something like a drop down bar programmed into the software to select each one? Or do you have to write a section of code to make the controller read the correct language?
  • LeonLeon Posts: 7,620
    edited 2010-08-24 14:13
    You use the appropriate compiler or interpreter for the language or variant of a language you are programming in.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2010-08-24 15:39
    There might be some development environments that let you choose different languages. However, each language needs its' own compiler to convert the source code into machine code understandale by the microcontroller. Usually you will need more than one program to use multiple languages. It will vary by vendor and the target microcontroller.

    If you're interested in learning more about microprocessors and how languages are developed, check out the book The Elements of Computing Systems: Building a Modern Computer from First Principles. You can preview it on Google books.
Sign In or Register to comment.