Jump to content

Which Language to Start With?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1
Ryan_C

Ryan_C

    Newbie

  • Members
  • Pip
  • 1 posts
Hello all,

Not quite sure if this goes here, but anyway..

I am about to enter college and am probably going to study software engineering (or whatever they call it) and am interested in robotics. My question is which programming language would be good to start with considering I want to work in robotics.

Thanks for any tips.

Ryan

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Robotics would suggest C or C++ to me. I prefer C++.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
Usually micro controllers with come with a C toolchain targeting them, either based on GCC or a Small-C compiler. You will at some point need to know assembly, and you may even have to write small stubs in hex, depending on how obscure the chip is.

C is always good to know. If nothing else, it'll help you write command and control applications on a desktop machine, or to transfer your compiled program via serial, usb, ect...

Edit: C++ is usually more of a pain than its worth in a non-hosted environment because of its runtime dependencies. While these are relatively easy to implement (the biggest PITA being stack unwinding for exceptions) its usually time you could be using to build a better bot.

#4
JCoder

JCoder

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 245 posts
C and asm is obligatory for serious work.
Java and Basic are also good to know (almost all ARM stuff can run Java natively).

#5
Aereshaa

Aereshaa

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 790 posts
Java? Basic? Hahahaha... Man, you post this stuff on every thread comparing languages. Why?
Like WingedPanther said, robotics obviously means C or asm. Anything else especially things with huge libraries like C++ or Java, are impractical if not impossible to use.
Watches: Nanoha, Haruhi, AzuDai. Listens to: E-Type, Dj Melodie, Nightcore.
"When people are wrong they need to be corrected. And then when they can't accept it, an argument ensues." - MeTh0Dz

#6
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

JCoder said:

C and asm is obligatory for serious work.
Java and Basic are also good to know (almost all ARM stuff can run Java natively).

Ok, this is getting serious... there is really something wrong with Java coders...

#7
JCoder

JCoder

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 245 posts
How come ARM runs Java natively?
How come Lego mindstorm uses Java as a programming language (maybe a toy, but still robotics)?
How come you can buy ARM-based kits for deveoping embedded systems in Java and C?
How come TVsets or Xero machines use Java in their microcontrollers?
Have you heard about BASCOM compiler for 80C51?

Java was designed primarly as an embedded systems language, though it didn't succeed then - it was too early and hardware was too poor.

BTW: I've said that C (pure C, not C++) is a mandatory language in embedded and OS programming. Really don't know why are you pointing at me now? ;)

#8
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

JCoder said:

How come ARM runs Java natively?
How come Lego mindstorm uses Java as a programming language (maybe a toy, but still robotics)?
How come you can buy ARM-based kits for deveoping embedded systems in Java and C?
How come TVsets or Xero machines use Java in their microcontrollers?
Have you heard about BASCOM compiler for 80C51?

Java was designed primarly as an embedded systems language, though it didn't succeed then - it was too early and hardware was too poor.

BTW: I've said that C (pure C, not C++) is a mandatory language in embedded and OS programming. Really don't know why are you pointing at me now? ;)


Java did not succeed not because of hardware but because the language itself. And about C++, you probably haven't read Bjarne list of C++ applications, there are many OS's referred there made in pure C++, this proves that C++ is a great language for embedded systems programming.

#9
JCoder

JCoder

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 245 posts
Well, none of the popular desktop OSes are made in C++. The same can be told about Java and C#.

Linux: C.
Windows: C.
xBSD: C
MacOS X: C + some parts in ObjectiveC (actually this is a BSD remake by Apple)


And academic solutions don't count (there are some C++, Java and C# based OSes but almost no-one uses them except researchers) ;)

Quote

C++ is a great language for embedded systems programming

With the exception that exceptions are not supported by most microcontrollers. Yeap, really great.

#10
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

JCoder said:

Well, none of the popular OSes are made in C++. The same can be told about Java.
And academic solutions don't count (there are some C++ and Java based OSes) ;)

I assume that you don't know that Symbian is made in C++, and is the most popular cellphone operative system, which is used by millions, it's more that popular, and there are many other minor OS's for cellphone made in C++ also, again, i recommend you to check the list again:

C++ Applications

#11
JCoder

JCoder

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 245 posts
Symbian kernel is not C++, only the APIs are C++. It is like saying Android is a Java OS because all APIs are in Java.

But still it is not a full fledged C++: it is rather C with classes. No templates, no exceptions, no C++ strings, no STL, weird memory handling. Definitely not a C++ style of coding. But actually this is a good thing, they dropped the most painful features of C++ and left the most powerful one: virtual method dispatch.

Quote

i recommend you to check the list again:

So what? The list of banks using COBOL is probably longer :D
This does not prove we should use COBOL for new banking projects, does it?

#12
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

JCoder said:

Symbian kernel is not C++, only the APIs are C++. It is like saying Android is a Java OS because all APIs are in Java.

But still it is not a full fledged C++: it is rather C with classes. No templates, no exceptions, no C++ strings, no STL, weird memory handling. Definitely not a C++ style of coding. But actually this is a good thing, they dropped the most painful features of C++ and left the most powerful one: virtual method dispatch.



So what? The list of banks using COBOL is probably longer :D
This does not prove we should use COBOL for new banking projects, does it?

Well, if you can find some information that says that symbian kernel is not C++ i would be grateful, what i read is "Symbian is natively written in C++". About the second paragraph, well, for the 1000th time you failed again to criticize C++ successfully. C++ is a multi-paradigm language, and supports really many styles of programming like Bjarne said many times, and this is obvious because C++ is a language full of features and it's powerful technical aspects allows the programmer to write in many styles accordingly to the context of the problem.