go away spammer

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

0 Members and 1 Guest are viewing this topic.

Offline SwecylonTopic starter

  • Beginner
  • *
  • Posts: 2
  • Helpful? 0
What programming language to use ?
« on: March 02, 2010, 05:18:48 AM »
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 ?

Is there any other advantages to using Assembler ? over Java/C ?

Thank you for help.

Swecylon

Offline HDA

  • Jr. Member
  • **
  • Posts: 24
  • Helpful? 0
Re: What programming language to use ?
« Reply #1 on: March 02, 2010, 09:07:52 AM »
Hi !

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.

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: What programming language to use ?
« Reply #2 on: March 02, 2010, 09:47:24 AM »
start with C.

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 find
a 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 ;-)

Chelmi.

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: What programming language to use ?
« Reply #3 on: March 02, 2010, 12:09:04 PM »
I started with asm and I've never regretted it. It has a bit of a learning curve, but if you understand how asm works you understand how the controller works.

And yes asm is incredibly fast, so if you want to (theoretically) get more code execution per cycle which leads to more code executed with less power consumed then go with it.

As far as bragging rights go, those who have better tools have better opportunities. :P

edit: and there are a lot of different avr assembly compilers that are great, imho arv-gcc is not one of them.
« Last Edit: March 02, 2010, 12:10:38 PM by z.s.tar.gz »
Save yourself the typing. Just call me Zach.

 


Get Your Ad Here

data_list