Programming Languages
Dylan Landry
Posts: 235
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?
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
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.
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
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.
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.