|
|
|
date: Wed, 29 Aug 2007 07:21:23 -0700,
group: uk.tech.robotics
back
Which programming language to learn
I have recently become interested in robotics - I've done a bunch of
reading, and am about to embark on a "first robot tutorial" on the
Society of Robotics website.
When I reach a more advanced level, I know I will need programming
skills. I haven't done any programming apart from some BASIC at
school 20 years ago! But I'm willing to learn. So, what would be the
best programming language for me to learn in connection with hobbyist
robotics? C++? Some form of BASIC? Or something else entirely?
date: Wed, 29 Aug 2007 07:21:23 -0700
author: dapunka
|
Re: Which programming language to learn
On Aug 29, 10:21 am, dapunka wrote:
> I have recently become interested in robotics - I've done a bunch of
> reading, and am about to embark on a "first robot tutorial" on the
> Society of Robotics website.
>
> When I reach a more advanced level, I know I will need programming
> skills. I haven't done any programming apart from some BASIC at
> school 20 years ago! But I'm willing to learn. So, what would be the
> best programming language for me to learn in connection with hobbyist
> robotics? C++? Some form of BASIC? Or something else entirely?
Both C and BASIC are well supported by microcontroller compilers /
interpreters, so either language is a good choice. I personally
prefer compiled C for my micro work (I use CCS's awesome C compiler).
On the (Windows) PC side, I recommend C# or VB.NET. Don't bother with
C++, as it and its COM/DCOM ilk are deprecated. .NET / C# / VB.NET is
where it's at now.
BRW
date: Wed, 29 Aug 2007 10:52:01 -0700
author: BRW
|
Re: Which programming language to learn
> Don't bother with C++...
I agree, unless you are writing a huge program, plain old C is much
simpler and reduces your risk of encountering compiler induced bugs.
Don't repeat that out loud on the C++ news group though or they will
start screeching and throwing feces at each other in protest. They can
be an ornery bunch when you suggest that C has any use in modern day
life.
For robot control C is great although I can see if you get into heavy
image processing or very complex behavior heuristics then C++ could
help insure isolation between software components. Of all the
programming languages, learning C will give you the best return on
your investment long term. An interpreted language like C# might help
speed things along when you are making constant changes but I dont
think you are going to find a C# interpreter for your 8 or 16 bit
micro controller.
Oh, and try to start with a PC as your experimenting platform. Buy a
few servos and hook them up to your serial port (or USB port) using
that Mini-SSC adapter thingy and just start making things move.
-howy
date: Wed, 29 Aug 2007 19:53:20 -0000
author: howy
|
Re: Which programming language to learn
BRW wrote:
> On Aug 29, 10:21 am, dapunka wrote:
>> I have recently become interested in robotics - I've done a bunch of
>> reading, and am about to embark on a "first robot tutorial" on the
>> Society of Robotics website.
>>
>> When I reach a more advanced level, I know I will need programming
>> skills. I haven't done any programming apart from some BASIC at
>> school 20 years ago! But I'm willing to learn. So, what would be the
>> best programming language for me to learn in connection with hobbyist
>> robotics? C++? Some form of BASIC? Or something else entirely?
>
> Both C and BASIC are well supported by microcontroller compilers /
> interpreters, so either language is a good choice.
Agreed. Not all Basic's are the same, but if you learn one
you can usually get something working on the other. ANSI-C
is really quite standardized, but most microcontroller C
compilers only implement a sub-set of ANSI-C. Thus, code
written for one microcontroller C compiler tends to need
some "tweaking" to get it to run on another microcontroller
C compiler. I'd vote for ANSI-C, but Basic is not a bad
choice either.
> I personally
> prefer compiled C for my micro work (I use CCS's awesome C compiler).
Many people are extremely happy with the CCS C compiler for
Microchip PIC microcontrollers. For the Atmel AVR folks,
most people use the GCC (Gnu C Compiler) tool chain which
is "free".
> On the (Windows) PC side, I recommend C# or VB.NET. Don't bother with
> C++, as it and its COM/DCOM ilk are deprecated. .NET / C# / VB.NET is
> where it's at now.
C# tends to be mostly Windows these days (although there is
the mono project for Linux.) C++ is available on more
platforms. Also, Java is quite popular. These languages
tend to require pretty beefy machines to run. There are
exceptions (C++ on the AVR) and the Java on PIC effort out
of the Netherlands, but for the most part you need a 32-bit
processor for the Java/C++/C# stuff.
Your mileage may vary,
-Wayne
date: Wed, 29 Aug 2007 20:46:45 GMT
author: Wayne C. Gramlich
|
Re: Which programming language to learn
On Aug 29, 9:21 am, dapunka wrote:
> I have recently become interested in robotics - I've done a bunch of
> reading, and am about to embark on a "first robot tutorial" on the
> Society of Robotics website.
>
> When I reach a more advanced level, I know I will need programming
> skills. I haven't done any programming apart from some BASIC at
> school 20 years ago! But I'm willing to learn. So, what would be the
> best programming language for me to learn in connection with hobbyist
> robotics? C++? Some form of BASIC? Or something else entirely?
Seems like a civil group....let me ask a question too.
What are the differences between C C++, C#, C.Net? and any other
variations out there?
I used to BASIC and PASCAL...each had its place.
I especially liked PASCAL...it allowed one to write readable and well
structured code.
TMT
date: Wed, 29 Aug 2007 16:31:27 -0700
author: Too_Many_Tools
|
Re: Which programming language to learn
Too_Many_Tools wrote:
> On Aug 29, 9:21 am, dapunka wrote:
>> I have recently become interested in robotics - I've done a bunch of
>> reading, and am about to embark on a "first robot tutorial" on the
>> Society of Robotics website.
>>
>> When I reach a more advanced level, I know I will need programming
>> skills. I haven't done any programming apart from some BASIC at
>> school 20 years ago! But I'm willing to learn. So, what would be the
>> best programming language for me to learn in connection with hobbyist
>> robotics? C++? Some form of BASIC? Or something else entirely?
>
> Seems like a civil group....let me ask a question too.
>
> What are the differences between C C++, C#, C.Net? and any other
> variations out there?
>
> I used to BASIC and PASCAL...each had its place.
>
> I especially liked PASCAL...it allowed one to write readable and well
> structured code.
I recommend reading the appropriate Wikipedia articles
to answer your question. Anything I write here would be
a rehash of what the articles already say.
Many people have fantastic religious wars about how language
A is better/worse that language B. These religious wars obscure
the fact that a programming language is a tool. In the hands
of a skilled programmer, each language can be made to sing;
likewise, in the hands of an amateur, the resulting code is not
pretty to read or debug.
Rather than focusing in on a particular programming language
it is probably more important to learn basic programming skills
that are applicable across most languages. Particularly important
programming skills for programming are 1) data structures and
2) debugging skills. There are many books on data structures,
but rather few books on debugging.
My $.02,
-Wayne
-Wayne
date: Thu, 30 Aug 2007 00:11:54 GMT
author: Wayne C. Gramlich
|
Re: Which programming language to learn
On 29 Aug, 21:46, "Wayne C. Gramlich" wrote:
> BRW wrote:
> > On Aug 29, 10:21 am, dapunka wrote:
> >> I have recently become interested in robotics - I've done a bunch of
> >> reading, and am about to embark on a "first robot tutorial" on the
> >> Society of Robotics website.
>
> >> When I reach a more advanced level, I know I will need programming
> >> skills. I haven't done any programming apart from some BASIC at
> >> school 20 years ago! But I'm willing to learn. So, what would be the
> >> best programming language for me to learn in connection with hobbyist
> >> robotics? C++? Some form of BASIC? Or something else entirely?
>
> > Both C and BASIC are well supported by microcontroller compilers /
> > interpreters, so either language is a good choice.
>
> Agreed. Not all Basic's are the same, but if you learn one
> you can usually get something working on the other. ANSI-C
> is really quite standardized, but most microcontroller C
> compilers only implement a sub-set of ANSI-C. Thus, code
> written for one microcontroller C compiler tends to need
> some "tweaking" to get it to run on another microcontroller
> C compiler. I'd vote for ANSI-C, but Basic is not a bad
> choice either.
>
> > I personally
>
> > prefer compiled C for my micro work (I use CCS's awesome C compiler).
>
> Many people are extremely happy with the CCS C compiler for
> Microchip PIC microcontrollers. For the Atmel AVR folks,
> most people use the GCC (Gnu C Compiler) tool chain which
> is "free".
>
> > On the (Windows) PC side, I recommend C# or VB.NET. Don't bother with
> > C++, as it and its COM/DCOM ilk are deprecated. .NET / C# / VB.NET is
> > where it's at now.
>
> C# tends to be mostly Windows these days (although there is
> the mono project for Linux.) C++ is available on more
> platforms. Also, Java is quite popular. These languages
> tend to require pretty beefy machines to run. There are
> exceptions (C++ on the AVR) and the Java on PIC effort out
> of the Netherlands, but for the most part you need a 32-bit
> processor for the Java/C++/C# stuff.
>
> Your mileage may vary,
>
> -Wayne
Thanks everyone for your advice! It's a coin-toss, C or BASIC... I'll
have to give it some thought. Thanks again.
date: Wed, 29 Aug 2007 17:16:29 -0700
author: dapunka
|
Re: Which programming language to learn
On Aug 30, 10:16 am, dapunka wrote:
> On 29 Aug, 21:46, "Wayne C. Gramlich" wrote:
>
>
>
>
>
> > BRW wrote:
> > > On Aug 29, 10:21 am, dapunka wrote:
> > >> I have recently become interested in robotics - I've done a bunch of
> > >> reading, and am about to embark on a "first robot tutorial" on the
> > >> Society of Robotics website.
>
> > >> When I reach a more advanced level, I know I will need programming
> > >> skills. I haven't done any programming apart from some BASIC at
> > >> school 20 years ago! But I'm willing to learn. So, what would be the
> > >> best programming language for me to learn in connection with hobbyist
> > >> robotics? C++? Some form of BASIC? Or something else entirely?
>
> > > Both C and BASIC are well supported by microcontroller compilers /
> > > interpreters, so either language is a good choice.
>
> > Agreed. Not all Basic's are the same, but if you learn one
> > you can usually get something working on the other. ANSI-C
> > is really quite standardized, but most microcontroller C
> > compilers only implement a sub-set of ANSI-C. Thus, code
> > written for one microcontroller C compiler tends to need
> > some "tweaking" to get it to run on another microcontroller
> > C compiler. I'd vote for ANSI-C, but Basic is not a bad
> > choice either.
>
> > > I personally
>
> > > prefer compiled C for my micro work (I use CCS's awesome C compiler).
>
> > Many people are extremely happy with the CCS C compiler for
> > Microchip PIC microcontrollers. For the Atmel AVR folks,
> > most people use the GCC (Gnu C Compiler) tool chain which
> > is "free".
>
> > > On the (Windows) PC side, I recommend C# or VB.NET. Don't bother with
> > > C++, as it and its COM/DCOM ilk are deprecated. .NET / C# / VB.NET is
> > > where it's at now.
>
> > C# tends to be mostly Windows these days (although there is
> > the mono project for Linux.) C++ is available on more
> > platforms. Also, Java is quite popular. These languages
> > tend to require pretty beefy machines to run. There are
> > exceptions (C++ on the AVR) and the Java on PIC effort out
> > of the Netherlands, but for the most part you need a 32-bit
> > processor for the Java/C++/C# stuff.
>
> > Your mileage may vary,
>
> > -Wayne
>
> Thanks everyone for your advice! It's a coin-toss, C or BASIC... I'll
> have to give it some thought. Thanks again.- Hide quoted text -
There is the option of learning both BASIC and C so you can use
whatever is suitable at the time.
--
jc
date: Wed, 29 Aug 2007 17:54:13 -0700
author: JGCASEY
|
Re: Which programming language to learn
On 30 Aug, 01:54, JGCASEY wrote:
> On Aug 30, 10:16 am, dapunka wrote:
>
>
>
> > On 29 Aug, 21:46, "Wayne C. Gramlich" wrote:
>
> > > BRW wrote:
> > > > On Aug 29, 10:21 am, dapunka wrote:
> > > >> I have recently become interested in robotics - I've done a bunch of
> > > >> reading, and am about to embark on a "first robot tutorial" on the
> > > >> Society of Robotics website.
>
> > > >> When I reach a more advanced level, I know I will need programming
> > > >> skills. I haven't done any programming apart from some BASIC at
> > > >> school 20 years ago! But I'm willing to learn. So, what would be the
> > > >> best programming language for me to learn in connection with hobbyist
> > > >> robotics? C++? Some form of BASIC? Or something else entirely?
>
> > > > Both C and BASIC are well supported by microcontroller compilers /
> > > > interpreters, so either language is a good choice.
>
> > > Agreed. Not all Basic's are the same, but if you learn one
> > > you can usually get something working on the other. ANSI-C
> > > is really quite standardized, but most microcontroller C
> > > compilers only implement a sub-set of ANSI-C. Thus, code
> > > written for one microcontroller C compiler tends to need
> > > some "tweaking" to get it to run on another microcontroller
> > > C compiler. I'd vote for ANSI-C, but Basic is not a bad
> > > choice either.
>
> > > > I personally
>
> > > > prefer compiled C for my micro work (I use CCS's awesome C compiler).
>
> > > Many people are extremely happy with the CCS C compiler for
> > > Microchip PIC microcontrollers. For the Atmel AVR folks,
> > > most people use the GCC (Gnu C Compiler) tool chain which
> > > is "free".
>
> > > > On the (Windows) PC side, I recommend C# or VB.NET. Don't bother with
> > > > C++, as it and its COM/DCOM ilk are deprecated. .NET / C# / VB.NET is
> > > > where it's at now.
>
> > > C# tends to be mostly Windows these days (although there is
> > > the mono project for Linux.) C++ is available on more
> > > platforms. Also, Java is quite popular. These languages
> > > tend to require pretty beefy machines to run. There are
> > > exceptions (C++ on the AVR) and the Java on PIC effort out
> > > of the Netherlands, but for the most part you need a 32-bit
> > > processor for the Java/C++/C# stuff.
>
> > > Your mileage may vary,
>
> > > -Wayne
>
> > Thanks everyone for your advice! It's a coin-toss, C or BASIC... I'll
> > have to give it some thought. Thanks again.- Hide quoted text -
>
> There is the option of learning both BASIC and C so you can use
> whatever is suitable at the time.
You're right, of course. Why limit myself?
date: Wed, 29 Aug 2007 18:18:32 -0700
author: dapunka
|
Re: Which programming language to learn
On Wed, 29 Aug 2007, Too_Many_Tools wrote:
> What are the differences between C C++, C#, C.Net? and any other
> variations out there?
>
> I used to BASIC and PASCAL...each had its place.
>
> I especially liked PASCAL...it allowed one to write readable and well
> structured code.
>
> TMT
C, originally a portable but high level "assembler" is a procedural
language designed in and around the original Unix operating system at
AT&T, and become useful for portable OS development, system level coding
and indeed, embedded programming, as it is a relatively low level language
which gets close the iron, and supports structures and syntax easily
supported directly by most processor instruction sets. C is simple,
straightforward, efficient and widespread with many implementations both
open source and commercial. (see also predecessors BCPL, B and variant D)
C++ was an extension to C created by Bjarne Stroustrup, and originally
consisted of a preprocessor which added object oriented features (objects,
classes, inheritance, operator overloading ...) to the intial C language,
which remains a valid subset of C++ by the way. Modern C++
implementations are full compilers, rather than a preprocessor tacked onto
the front of a C compiler. C++ is often criticized as being a write only
language, and indeed it is easy to write convoluted and undecipherable
C++, and this is exacerbated by the features which continue to creep into
the language over time. Smalltalk, it is not!
C# is a language developed by Microsoft to counter Java, and in this
regard has many similarities to Java (as opposed to C). C# was closely
linked to the .net environment on Windows, and was more about locking
software onto the Microsoft platform. This has been countered to some
extent by the existance of the open source Mono project which has a
portable implementation of the .net environment on Linux/Unix, and which
is not on Microsoft platforms.
C.net? Visual C? Visual C++? simply a compiler/IDE with bundled Windows
libraries for Win32, and the .net wrapper for the Microsoft environment.
Pascal is similar to C in certain respects, but indeed, has aspects common
to Ada, in that strong type checking, nested functions, and some aids to
prevent programming errors. Assignment (:= vs =) is sufficiently
different from logical test (= vs ==) to avoid many common C bugs.
Basic is an ideal language for babies, or hw engineers who think that
programming is mostly done with solder, and can't be bothered to learn
programming in a proper language (eg: C or Forth). The BASIC various
dialects are so numerous and so different from any standard, that no two
basics share much in common. Microsoft's Visual Basic as a case in point
has very little to do with basic, and was named mostly to impress
potential programmers as to how easy it is to use (propaganda).
Having said this, I'm surprised that noone on this thread has mentioned
Forth as an embedded language, as it in certain respects beats most
languages hands down for robotics. Originally used to control
telescopes for astronomical tracking, this langage has been around since
Charles Moore described it in the very early 1970's, and literally exists
on just about every processor invented by man.
Forth is often "available" as an option wherever embedded basic is
available, and typically offered as a me-too. Having gone through the
learning curve with Forth, with its embedded assembler(s) cross
compilation, metacompilation simple multitasking, and inherent ability to
bit-bang, it is very close to the hardware, high level words can be
re-written in assembly for efficiency when needed, there are all kinds of
advantages.
Anyway, I hope the above (admittedly biased) descriptions help ... 8-)
Cheers,
Rob Sciuk
date: Wed, 29 Aug 2007 22:42:42 -0400
author: unknown
|
Re: Which programming language to learn
Too_Many_Tools wrote:
>
> Seems like a civil group....let me ask a question too.
>
> What are the differences between C C++, C#, C.Net? and any other
> variations out there?
One of the biggest differences is that its pretty easy to get your
application written in C to run on a $2.50 (qty 1) CPU. Using avr-gcc I
once put a 600 byte application on an AVR that cost less than $2.50 from
DigiKey.
Microchip has been the darling of hobbyists in the past. Today I suggest
looking at the Atmel AVR products. Also the free WinAVR and other
avr-gcc tool chains.
Don't go more than a day into your project without some form of revision
control. Starting cold turkey you should give preference to Subversion.
TotoiseSVN would be my recommendation for Windows. CVS is also a good
choice. Nightly backups is not as good altho you should routinely backup
the version control repository.
You should commit your changes every time you have mostly completed
something. Use short descriptions to the commit, "Started serial command
processing routines." Should commit several times per day, and always at
the end of the day. Then for fun use the version comparison functions in
TortioseSVN (or TortoiseCVS) and it should become obvious why one should
use version control if it wasn't already.
Ironically one of the most common practical uses I get of CVS and SVN
(have projects under both that are not practical to convert) is file
synchronization between machines. Just go to the project directory and
"update". CVS or SVN goes to the proper place and updates local files
and/or flags those that have changed locally so that one can reconcile
the differences.
http://www.bdmicro.com/ has good AVR stuff, robotics oriented. I have
used a MAVRIC board to prototype before laying out my own board
optimized for my application.
For $40 this is an awfully good value for programming and in-circuit
debugging of most (double check first) AVRs which support JTAG
interface: http://www.ecrostech.com/AtmelAvr/AvrIceCube/index.htm
The $4 10-way Ribbon Cable and $3 Cable Adapter are very handy. If you
need them you will have spent more than $7 in frustration learning that
you needed them. Forgot why the Cable Adapter is needed.
The AVR Dragon for $52 will handle some newer JTAG AVRs the ICECube will
not, has Debug Wire the ICECube lacks, but will not handle the larger
AVRs (as used on the MAVRIC boards) that ICECube does.
date: Thu, 30 Aug 2007 09:07:58 -0500
author: David Kelly
|
Re: Which programming language to learn
On Aug 29, 8:11 pm, "Wayne C. Gramlich" wrote:
> Too_Many_Tools wrote:
> > On Aug 29, 9:21 am, dapunka wrote:
> >> I have recently become interested in robotics - I've done a bunch of
> >> reading, and am about to embark on a "first robot tutorial" on the
> >> Society of Robotics website.
>
> >> When I reach a more advanced level, I know I will need programming
> >> skills. I haven't done any programming apart from some BASIC at
> >> school 20 years ago! But I'm willing to learn. So, what would be the
> >> best programming language for me to learn in connection with hobbyist
> >> robotics? C++? Some form of BASIC? Or something else entirely?
>
> > Seems like a civil group....let me ask a question too.
>
> > What are the differences between C C++, C#, C.Net? and any other
> > variations out there?
>
> > I used to BASIC and PASCAL...each had its place.
>
> > I especially liked PASCAL...it allowed one to write readable and well
> > structured code.
>
> I recommend reading the appropriate Wikipedia articles
> to answer your question. Anything I write here would be
> a rehash of what the articles already say.
http://en.wikiquote.org/wiki/Programming -- especially. it's not
always obvious which quotations are supporters and which are
detractors, though.
> Many people have fantastic religious wars about how language
> A is better/worse that language B. These religious wars obscure
> the fact that a programming language is a tool. In the hands
> of a skilled programmer, each language can be made to sing;
> likewise, in the hands of an amateur, the resulting code is not
> pretty to read or debug.
technically speaking what you really mean is that in the hands of a
skilled programmer any language can be used to simulate a turing
machine. sing is subjective. if you take a brilliant lisp hacker and
make him write java servlet pages, he'll be able to do it, but he
won't describe it as "singing". he'll tie a noose with his mouse
cable and hang himself. the desire to avoid that leads to fanaticism.
> Rather than focusing in on a particular programming language
> it is probably more important to learn basic programming skills
> that are applicable across most languages. Particularly important
> programming skills for programming are 1) data structures and
> 2) debugging skills. There are many books on data structures,
> but rather few books on debugging.
while programming concepts are similar across languages, language
choice affects how you think about programming (see also: sapir-whorf)
as well as which operations are simple vs. contrived. in the last
week, i have worked on code in three languages: c, c++, and perl, for
three projects: a website i'm writing, an avr in a robot, and a high
performance distributed server system for my job. assuming for now
that i'm a skilled programmer, do you really think i could make those
"sing" in any language/project combination?
if the goal is programming small microcontrollers for robots, in the
long run the best option is to learn c.
-chris.
date: Fri, 31 Aug 2007 18:24:01 -0000
author: e c kern
|
Re: Which programming language to learn
On 31 Aug, 19:24, e c kern wrote:
> On Aug 29, 8:11 pm, "Wayne C. Gramlich" wrote:
>
>
>
> > Too_Many_Tools wrote:
> > > On Aug 29, 9:21 am, dapunka wrote:
> > >> I have recently become interested in robotics - I've done a bunch of
> > >> reading, and am about to embark on a "first robot tutorial" on the
> > >> Society of Robotics website.
>
> > >> When I reach a more advanced level, I know I will need programming
> > >> skills. I haven't done any programming apart from some BASIC at
> > >> school 20 years ago! But I'm willing to learn. So, what would be the
> > >> best programming language for me to learn in connection with hobbyist
> > >> robotics? C++? Some form of BASIC? Or something else entirely?
>
> > > Seems like a civil group....let me ask a question too.
>
> > > What are the differences between C C++, C#, C.Net? and any other
> > > variations out there?
>
> > > I used to BASIC and PASCAL...each had its place.
>
> > > I especially liked PASCAL...it allowed one to write readable and well
> > > structured code.
>
> > I recommend reading the appropriate Wikipedia articles
> > to answer your question. Anything I write here would be
> > a rehash of what the articles already say.
>
> http://en.wikiquote.org/wiki/Programming-- especially. it's not
> always obvious which quotations are supporters and which are
> detractors, though.
>
> > Many people have fantastic religious wars about how language
> > A is better/worse that language B. These religious wars obscure
> > the fact that a programming language is a tool. In the hands
> > of a skilled programmer, each language can be made to sing;
> > likewise, in the hands of an amateur, the resulting code is not
> > pretty to read or debug.
>
> technically speaking what you really mean is that in the hands of a
> skilled programmer any language can be used to simulate a turing
> machine. sing is subjective. if you take a brilliant lisp hacker and
> make him write java servlet pages, he'll be able to do it, but he
> won't describe it as "singing". he'll tie a noose with his mouse
> cable and hang himself. the desire to avoid that leads to fanaticism.
>
> > Rather than focusing in on a particular programming language
> > it is probably more important to learn basic programming skills
> > that are applicable across most languages. Particularly important
> > programming skills for programming are 1) data structures and
> > 2) debugging skills. There are many books on data structures,
> > but rather few books on debugging.
>
> while programming concepts are similar across languages, language
> choice affects how you think about programming (see also: sapir-whorf)
> as well as which operations are simple vs. contrived. in the last
> week, i have worked on code in three languages: c, c++, and perl, for
> three projects: a website i'm writing, an avr in a robot, and a high
> performance distributed server system for my job. assuming for now
> that i'm a skilled programmer, do you really think i could make those
> "sing" in any language/project combination?
>
> if the goal is programming small microcontrollers for robots, in the
> long run the best option is to learn c.
>
> -chris.
Thank you chris, and everyone else who replied. It's been very
helpful, and has focused my attention.
date: Fri, 31 Aug 2007 20:59:46 -0700
author: dapunka
|
Re: Which programming language to learn
dapunka wrote:
> On 31 Aug, 19:24, e c kern wrote:
>> On Aug 29, 8:11 pm, "Wayne C. Gramlich" wrote:
[snip]
>>> Many people have fantastic religious wars about how language
>>> A is better/worse that language B. These religious wars obscure
>>> the fact that a programming language is a tool. In the hands
>>> of a skilled programmer, each language can be made to sing;
>>> likewise, in the hands of an amateur, the resulting code is not
>>> pretty to read or debug.
>> technically speaking what you really mean is that in the hands of a
>> skilled programmer any language can be used to simulate a turing
>> machine. sing is subjective. if you take a brilliant lisp hacker and
>> make him write java servlet pages, he'll be able to do it, but he
>> won't describe it as "singing". he'll tie a noose with his mouse
>> cable and hang himself. the desire to avoid that leads to fanaticism.
I was not trying to say that the languages are interchangable;
they are not. What I was saying is a that a skilled programmer
will know how to write reasonable code for each language.
Indeed, they will choose the language based on the problem
at hand.
Actually, I do know some phenomenal LISP hackers and they
have largely moved onto other languages. Many of them
now regularly program in languages other than LISP with
committing suicide.
>>> Rather than focusing in on a particular programming language
>>> it is probably more important to learn basic programming skills
>>> that are applicable across most languages. Particularly important
>>> programming skills for programming are 1) data structures and
>>> 2) debugging skills. There are many books on data structures,
>>> but rather few books on debugging.
>> while programming concepts are similar across languages, language
>> choice affects how you think about programming (see also: sapir-whorf)
>> as well as which operations are simple vs. contrived. in the last
>> week, i have worked on code in three languages: c, c++, and perl, for
>> three projects: a website i'm writing, an avr in a robot, and a high
>> performance distributed server system for my job. assuming for now
>> that i'm a skilled programmer, do you really think i could make those
>> "sing" in any language/project combination?
In the likely situation where you are a skilled programmer,
I suspect that you use the best language for the application at
hand. I repeat, I was not trying to say that languages are
interchangable.
I've been writing code since the 1960's, so I have quite a
number of programming languages that I've used over the years
(Algol, FORTRAN IV, APL, PDP-8 assembler, PDP-10 assembler,
8080 assembler, Bliss-10, SAIL, Pascal, Bliss-11, K&R C, Clu,
Snobol, 808x assembler, C++, Bourne Shell, Tcl/Tk, Java, Perl,
SQL, Python, Microchip PIC assembler, etc.) Many of the skills
that I learned in now obsolete languages have been transfered
to newer languages. Thus, my paragraph above was trying to
focus on learning useful transferableprogramming concepts rather
than just programming languages.
>> if the goal is programming small microcontrollers for robots, in the
>> long run the best option is to learn c.
I agree, C is an excellent choice for embedded microcontrollers.
-Wayne
date: Sun, 02 Sep 2007 00:27:55 GMT
author: Wayne C. Gramlich
|
Re: Which programming language to learn
Wayne C. Gramlich wrote:
> Actually, I do know some phenomenal LISP hackers and they
> have largely moved onto other languages. Many of them
> now regularly program in languages other than LISP with
> committing suicide.
Typo: I meant "... with[out] committing suicide."
oops.
-Wayne
date: Sat, 01 Sep 2007 17:49:43 -0700
author: Wayne C. Gramlich
|
Re: Which programming language to learn
On Aug 29, 9:42 pm, s...@controlq.com wrote:
> Basic is an ideal language for babies, ...
I think this is the standing myth, but it misses BASIC's historical
origins. BASIC was named because the authors wanted a very basic
language. But it's early popularity was not its simplicity, but its
interactivity. I would suggest it was one of the very early IDE's
(integrated development environments). If you were a beginner and were
going to write a program in the '70's, you have your choice.
1) Learn how to launch BASIC. Start typing.
2) Or learn how to launch an editor, learn the system file structure
and save your edited source with only allowed character names and
extensions, learn how to launch a compiler, with half a dozen command
line parameters, which implies learning the command line structure of
the system as well, learn how to launch an assembler, again with
command line parameters, extensions, and file modifications, learn how
to run a linker, etc., and then see if your program did anything but
crash. The differences were astounding. BASIC accomplished this by
being interactive. You could enter your program, edit your program,
run your program, all from the terminal. So BASIC became popular by
being interactive.
Lest we forget interactivity was what made the Personal Computer,
well, personal. Most contact with computers in the 1970's was through
a punch card deck. Someone else took care of the JCL cards that
proceeded and followed your job, and a print out was all you got back.
Unless you were a system guy, you never saw the part where all that
was done. The JCL (or the paper tape, or even the front switch panel)
was the interactive part.
Now those days are gone. The new "Basic"s aren't interactive any more.
They are roughly like any conventional language. Hence only the
leagacy of "simple" carries Basic forward, and the simpicity stands in
the way of useability, without the advantage of interactivity. Yet it
tends to be a very low performance language, speed-wise.
> Having said this, I'm surprised that noone on this thread has mentioned
> Forth as an embedded language, as it in certain respects beats most
> languages hands down for robotics.
Yes, sorry. Generally promoting Forth falls to me, here (self
appointed). Been down sick for over a week (or should I say very
weak).
Forth retains its interactivity (most versions), runs natively on the
final system, has good speed (particularly for a language retaining
interactivity), and has unparallel code compaction. Forth is generally
available at very reasonable prices, as well as in freewear
"unsupported" versions.
In robotics, the wonderful thing about Forth is, again, its
interactivity. You don't have to wonder what value some variable
holds, you can query it and see. You don't have to wonder if some
output is high or low, you can query it and see. You don't have to
wonder what some input from a sensor is, you can query it and see. You
don't have to wonder if changing some variable slightly would do, you
can just set the value and try it. You don't have to wonder if some
servo is working or not, you can just try it, set it where you want,
and see if it follows. And so on. They way you do these sorts of
changes with conventional debugging are usually convoluted and
complex, and done with very expensive ICE equipment, while Forth
programmers feel totally enabled with a tiny bag of tools readily at
hand.
Interactivity. Nearly a lost concept in the world of modern
programming.
You might want to atleast have a look at Forth. MPE is one of the
remaining leading vendors, and is resident in the UK.
--
Randy M. Dumse
www.newmicros.com
Caution: Objects in mirror are generally more confused than they
appear.
date: Sun, 02 Sep 2007 09:22:23 -0700
author: RMDumse
|
Re: Which programming language to learn
Hello,
I am programmer by profession.
Robotics is just my hobby.
I use Java (J2ME - Java in cell phones) for robotics.
See: http://www.RoboHobby.com
We created J2ME-based robot, with uses phone camera as a sensor and it
is even possible to see where the robot is going.
If you want to program microchips, I recommend you to use C language
(not C++).
C language is supported for a lot of devices (chips).
It is most popular language (after assembler) for microchips.
Also BASIC is supported on some chips.
All the other languages (C++, Phyton, Java, etc.) are not so popular.
If you ask me personally, I like Java because I use this language for
programming things of any size - big data driven systems, web sites,
cell phones, PDAs, etc.
It works on many platforms and I like this language very much.
Sincerely, Oleg
-----------------------
On Aug 29, 6:21 pm, dapunka wrote:
> I have recently become interested in robotics - I've done a bunch of
...
> best programming language for me to learn in connection with hobbyist
> robotics? C++? Some form of BASIC? Or something else entirely?
date: Mon, 03 Sep 2007 10:30:29 -0000
author: RoboHobby
|
Re: Which programming language to learn
On Sun, 2 Sep 2007, RMDumse wrote:
>
> On Aug 29, 9:42 pm, s...@controlq.com wrote:
>> Basic is an ideal language for babies, ...
>
> I think this is the standing myth, but it misses BASIC's historical
> origins. BASIC was named because the authors wanted a very basic
> language. But it's early popularity was not its simplicity, but its
> interactivity. I would suggest it was one of the very early IDE's
> (integrated development environments). If you were a beginner and were
> going to write a program in the '70's, you have your choice.
>
> 1) Learn how to launch BASIC. Start typing.
Randy, This tongue in cheek response was meant in jest, and in no way
to slag your products. My main problem with BASIC, is that some people
will call any simple language "basic" regardless its syntax/roots.
Standardization remains the one real problem here.
>
> 2) Or learn how to launch an editor, learn the system file structure
> and save your edited source with only allowed character names and
> extensions, learn how to launch a compiler, with half a dozen command
> line parameters, which implies learning the command line structure of
> the system as well, learn how to launch an assembler, again with
> command line parameters, extensions, and file modifications, learn how
> to run a linker, etc., and then see if your program did anything but
> crash. The differences were astounding. BASIC accomplished this by
> being interactive. You could enter your program, edit your program,
> run your program, all from the terminal. So BASIC became popular by
> being interactive.
>
> Lest we forget interactivity was what made the Personal Computer,
> well, personal. Most contact with computers in the 1970's was through
> a punch card deck. Someone else took care of the JCL cards that
> proceeded and followed your job, and a print out was all you got back.
> Unless you were a system guy, you never saw the part where all that
> was done. The JCL (or the paper tape, or even the front switch panel)
> was the interactive part.
been there, done that!
>
> Now those days are gone. The new "Basic"s aren't interactive any more.
> They are roughly like any conventional language. Hence only the
> leagacy of "simple" carries Basic forward, and the simpicity stands in
> the way of useability, without the advantage of interactivity. Yet it
> tends to be a very low performance language, speed-wise.
>
Forth has all the interactivity and simplicity of BASIC, is generally
faster, more compact and portable, and has the added advantage of ANS/ISO
standardization, embedded assembly, simple multitasking, various
levels of hardware register and interrrupt support etc. etc. While it has
a steeper learning curve than BASIC, IMHO, it is well worth the effort!
>> Having said this, I'm surprised that noone on this thread has mentioned
>> Forth as an embedded language, as it in certain respects beats most
>> languages hands down for robotics.
>
> Yes, sorry. Generally promoting Forth falls to me, here (self
> appointed). Been down sick for over a week (or should I say very
> weak).
>
> Forth retains its interactivity (most versions), runs natively on the
> final system, has good speed (particularly for a language retaining
> interactivity), and has unparallel code compaction. Forth is generally
> available at very reasonable prices, as well as in freewear
> "unsupported" versions.
>
> In robotics, the wonderful thing about Forth is, again, its
> interactivity. You don't have to wonder what value some variable
> holds, you can query it and see. You don't have to wonder if some
> output is high or low, you can query it and see. You don't have to
> wonder what some input from a sensor is, you can query it and see. You
> don't have to wonder if changing some variable slightly would do, you
> can just set the value and try it. You don't have to wonder if some
> servo is working or not, you can just try it, set it where you want,
> and see if it follows. And so on. They way you do these sorts of
> changes with conventional debugging are usually convoluted and
> complex, and done with very expensive ICE equipment, while Forth
> programmers feel totally enabled with a tiny bag of tools readily at
> hand.
>
> Interactivity. Nearly a lost concept in the world of modern
> programming.
>
> You might want to atleast have a look at Forth. MPE is one of the
> remaining leading vendors, and is resident in the UK.
>
MPE is a fine company, and they (Stephen Pelc) offers a free programming
in Forth .pdf tutorial which is a *VERY* good introduction to Forth:
http://www.mpeltd.demon.co.uk/arena/ProgramForth.pdf
Additionally, free/GPL'ed versions of Forth exist for classic 8 bit
(8051/8088/6502/6809) processors, as well as more recent (PIC/AVR/ARM etc)
SoC's and versions for Windows, Unix, Linux, Mac, some with X-development
tools for metacompilation and meta assembly ...
> --
> Randy M. Dumse
> www.newmicros.com
> Caution: Objects in mirror are generally more confused than they
> appear.
Thanks, Randy, and again, BASIC is not really a language for babies, and
engineers who prefer soldering to coding, but Forth offers a *VERY*
good alternative for the embedded developer, IMHO ...
date: Tue, 4 Sep 2007 17:51:36 -0400
author: unknown
|
|
|