Author
Topic: What programming language to use ? (Read 1126 times)

Hello, first post here, I'm from Sweden, I own a dog French bulldog and his name is Cylon, hence the name.

I'm soon gonna build my self a robot, ma by the 50$ one or a kit, haven't decided yet. I'm NOT gonna use 'Basic' (holds up a cross ).But I'm thinking about using Java, or C, ma by even assembly. I don't know Java or Assembler, but I'm getting the impression Assembler makes the bot run code faster, am I correct? Assembler how ever is a lot harder to learn than Java, ofcource programming in Assembler gives you the bragging rights ( I assume).

I'm also under the impression Assembler programming changes somehow based on what PIC you are using? is this a lot ?

In my opinion, assembler language is a bit hard to begin !!For each microcontroller in different suppliers : you'll have to learn a new assembler.C language for instance is more "comfortable" in debugging phase & to use public library.There are no real difference beetween assembler & C language for classical applications (in robotic field), no virtual machine (like Java). furthermore you can add portion of assembler in your C code for very critical treatment.So my advice is to begin with C language.

Nowadays compiler are quite good and they will often generate very efficient code. More than often it will be more optimized than hand-written assembly.So there is, in my opinion, no point in writing your application only in assembly language. It might be necessary for very critical loops, but start with C and if you finda place were the code by avr-gcc is inefficient you can write in assembly language (as HDA explained).

As for the bragging rights, I have a tendency to admire people who can choose the right tool for the right task ;-)