What programming language to learn ?!

I have never studied programming before , and i am interested in bying an arduino uno .How am i going to programm it ? Should i start learning any programming language so it will be easier to programm the arduino? I have no idea how am i going to learn how to programm the arduino :smiley:

The free Arduino IDE uses a version of C and C++.
You can learn using the Arduino.
The Arduino main site has pages of reference, examples (included in the IDE), and information, like Foundations.

But you might want to find C tutorials on the web.

any C like language is fine. (C, C++, Java, C#). For learning the basics, they're all pretty much the same (except for C being more limited).
My advice would be Java, it is free, you can easily find IDE's that work on your computer, so you can run simple test programs on your computer, and you can find lots of very basic tutorials for it to grasp the basics of programming.

once you understand objects, classes, loops, variables, arrays, datatypes, conditionals, ... you'll have a solid basis for programming for the arduino :).

Get the Arduino and dive straight in using C++ in the IDE. Learn by using it and expand your knowledge as you go.

Sorry, but I can't resist ....

Keep as far away from Java as you can. I am a great fan of the JVM, but the standard way of writing Java programs is death inducing. There are lots of other ways for programming on the JVM but they aren't really relevant to the Arduino.

I would say the same about C/C++ except that it's the only way to program the Arduino and the Arduino IDE takes out an enormous amount of the pain.

...R

UKHeliBob:
Get the Arduino and dive straight in..........

That is the best advice you are going to get. Using anything else is just plain silly. Whatever it is, the language provided by Arduino in their IDE is the language you know will work, it's the language most other people speak, and the people that don't are the people you don't need to listen to.

voultsi:
I have never studied programming before , and i am interested in bying an arduino uno .How am i going to programm it ? Should i start learning any programming language so it will be easier to programm the arduino? I have no idea how am i going to learn how to programm the arduino :smiley:

If you want to learn low-level programming then get "The C Programming Language. 2nd Edition" by Kernighan and Ritchie. After you work through that book, programming on the Arduino will be a breeze. From the problems we see on this message board, too many people seemed to have skipped this stage.

If on the other hand you are interested in programming in general then skip the Arduino. It's not a good platform to learn programming. There isn't a top-flight university in the world that teaches programming with microcontrollers. Your PC is a great platform. I would suggest fldit-www.cs.uni-dortmund.de/~peter/PS07/HR.pdf as a cheap and excellent grounding in how to think like a programmer.

racemaniac:
any C like language is fine. (C, C++, Java, C#). For learning the basics, they're all pretty much the same (except for C being more limited).

The Church-Turing thesis says C is not more limited. The fact that the others can be implemented in C should be the major clue!

Robin2:
Sorry, but I can't resist ....

Keep as far away from Java as you can. I am a great fan of the JVM, but the standard way of writing Java programs is death inducing. There are lots of other ways for programming on the JVM but they aren't really relevant to the Arduino.

I would say the same about C/C++ except that it's the only way to program the Arduino and the Arduino IDE takes out an enormous amount of the pain.

...R

Can you then link some good tutorials people who don't have an arduino yet can use to get started with? The reason i advise Java is that when it's about the very basics (tutorials showing command line programs that show basics about classes, methods, arrays, loops, conditionals), it's pretty much identical to arduino (except for writing to a console instead of serial).
Of course it's just for learning those basics, once you've grasped those concepts, there is no use in starting to make guis and other things java has that arduino hasn't. And for these very basics there are tons of very clear and beginner friendly tutorials to be found that only handle these very basics :), and also properly explain all the concepts the people need to grasp, and people don't need their arduino yet to be able to run their programs :).

Maybe it's just because i come from an IT background that i would recommend this, so i'm very open to better suggestions :). It's just that when i see those basic java tutorials explaining all these very important base concepts that arduino users also need to know, and that are identical on both platforms, i think it's a pretty good suggestion :).
And i know the arduino site has some examples and a nice reference section. but for a true beginner it's a bit lacking, it's nice of you already have a basic grasp and idea, but if you're really starting from scratch it's not really holding you hand trough the journey and nicely explaining everything :).

bwat:

racemaniac:
any C like language is fine. (C, C++, Java, C#). For learning the basics, they're all pretty much the same (except for C being more limited).

The Church-Turing thesis says C is not more limited. The fact that the others can be implemented in C should be the major clue!

Lol XD
naturally it's not limited in what you can do with it, but it is more limited in syntax :). It would be wiser to learn an OO language so you can also write classes for your arduino, and understand the sketches that do so, than to stick to strict C and have to roll your own OO like structures and being puzzled when encountering C++ stuff :).

racemaniac:
than to stick to strict C and have to roll your own OO like structures and being puzzled when encountering C++ stuff :).

Nobody suggested sticking to C. C++ is not a problem for good C programmers.

bwat:

racemaniac:
than to stick to strict C and have to roll your own OO like structures and being puzzled when encountering C++ stuff :).

Nobody suggested sticking to C. C++ is not a problem for good C programmers.

I'm not sure if you're just being a troll or not 0_o.
he's obviously not a good C programmer yet, so it would be good if he started with something that also explains the object oriented basics immediately, rather then keep him making complex procedural stuff instead of learning how with a more modern language he can nicely split it up into objects and make it more manageable :).

voultsi:
how am i going to learn how to programm the arduino :smiley:

If your goal is to program the Arduino then the way to learn to do that is to download the Arduino IDE and look at the examples, starting with the basic ones, and see how they work. Then get an Arduino and try running them. Learning by doing really is the best way to learn.

bwat:
C++ is not a problem for good C programmers.

Then why are you mentioning it on this thread...

voultsi:
I have never studied programming before...

racemaniac:
The reason i advise Java...

Which has a different syntax, is purely object oriented, and is taught against a computer with infinite resources. Those three alone make it a highly inappropriate suggestion for someone starting their Arduino adventure.


The correct answer is...

voultsi:
How am i going to programm it ?

C.

voultsi:
Should i start learning any programming language so it will be easier to programm the arduino?

Yes. C.

voultsi:
I have no idea how am i going to learn how to programm the arduino

Read...
http://www.ladyada.net/learn/arduino/

http://arduino.cc/en/Tutorial/HomePage

...then do. In small increments. Repeat.

You should learn C first, especially on such resource-limited machines as microcontrollers.
That does not mean never learn C++, but get proficient with C and learn the hardware limits so that you can know which parts of C++ are not appropriate on the hardware/chip you are programming.

Don't try to choke everything down at once. Learn in steps that include doing every time.

racemaniac:
Can you then link some good tutorials people who don't have an arduino yet can use to get started with?

As someone else said the best plan is to jump straight in. You can download the Arduino IDE without having an Arduino board. It has lots of examples to study. And there are plenty of online tutorials. You can modify the examples or write your own sketches and verify (compile) them.

Of course you can't run an Arduino program without an Arduino board and even if it compiles a program may not work as intended.

Different people learn in different ways. Some people seem content to learn the theory before any practical experience. Other people like to start with practical stuff and only learn as much theory as they need. Some people like reading lots of stuff and absorb knowledge that way without formal study. Other people read as little as they possibly can.

I especially like the Arduino system because it is very easy to learn by doing. I see many people posting questions here that they could have answered themselves in a fraction of the time by writing a short sketch to see how their idea works.

I can (with some reluctance) understand the attraction of the formality of Java programming in a commercial environment. No doubt, like anything else, one becomes familiar with its verbosity with practice. But it always seems to me to present a forbidding and impenetrable barrier to beginners unless they have the patience to study things from the ground up.

Also, as someone else has said, a significantly different mindset is required for programming in the limited Arduino environment compared to which a PC (or even a smartphone) has unlimited RAM and storage space.

...R

It's ironic that Java has been suggested as a way to learn to program an Arduino. I'm sure the original Arduino developers would be delighted with the idea. I don't think it has every been acknowledged or confirmed, but I am fairly sure that one of the underlying objectives of the Arduino project was to make the Arduino Wiring language look and behave as close as possible to the Processing language, i.e. Java. It was in my opinion one of their biggest mistakes and has given us daft features such as the serialEvent callbacks (that aren't compatible with any other sensible event handling scheme), the String class (which uses dynamic memory allocation in way that is not sensible in an embedded system), automatic function prototyping (that means Arduino code no longer provides the same behaviour that 'C'/C++ programmers would expect, and falls over with even quite simple and sensible code) and the peculiar techniques used to automagically select the set of source files and include paths that attempt to emulate a classpath, but without providing any of the associated control or scalability. In all respects that I can see, the design decisions which provide Java-like behaviour have been poor ones.

Java is not 'C', and learning Java is not easier than learning 'C' and is not good preparation for learning to program 'C'. If anything the reverse is true: 'C' experience will provide a good basis for learning Java programming since Java is basically a 'C'-like block structured language with OO features and multi-threading and heap management and all that baggage added on top.

The best way to learn to program an Arduino is to look at the examples that come with the IDE, get the general idea of what they're doing and how the code relates to the functionality, and then play around with them. It really helps to have a physical Arduino so that you can actually run them, too. If necessary you can write simple 'C' programs outside the IDE and run them on a PC, but it will need you to find and learn to use a different development environment. If you want to learn to program an Arduino, getting a physical Arduino should be one of your first steps. Fortunately they're cheap and readily available.

Thanks for the serious replies guys :slight_smile:

I can agree with some of the points you guys made. I still think you've got a bit of a narrow view. I know that i might come across as saying "just learn java", the thread title is indeed "which language to learn?". I should have nuanced more that i would also suggest going for c++, but when he doesn't have an arduino yet, starting with a good java tutorial still sounds like a good idea, and won't teach you anything wrong.

I do find your views interesting, and my first steps were with a parent that already know how to program, so i had someone to help me out. I hope the OP will also look at my suggestion, and if it's closer to his way of learning ,i'm sure he won't regret it. If he prefers what you guys are suggesting, then he should go that way :).

I do find it sad sometimes to see that programming is often treated as a necessary evil, something not to spend too much time on here. Being good at it, and getting all the conceptual things right is also important, and something a lot of people here seem to forget.

PeterH:
The best way to learn to program an Arduino is to look at the examples that come with the IDE, get the general idea of what they're doing and how the code relates to the functionality, and then play around with them.

And ask occasional informed questions after searching the site and forum and not finding answers.
:wink:

Thank you all for your great answers , i am going to first download and print the book : Getting Started with Arduino (Make: Projects) from MASSIMO BANZI , and probably i am going to download either the book ''The C Programming Language'' ---> http://www.amazon.com/The-Programming-Language-2nd-Edition/dp/0131103628/ref=sr_1_1?ie=UTF8&qid=1404643833&sr=8-1&keywords=The+C+Programming+Language or the book ''C Programming Absolute Beginner's Guide '' ---> http://www.amazon.com/Programming-Absolute-Beginners-Guide-3rd/dp/0789751984/ref=sr_1_2?s=books&ie=UTF8&qid=1404643716&sr=1-2&keywords=c+programming+language
I just need to figure out wich is more beginner friendly of those two

I like to view tutorials, etc, on a web browser tab because I can make the type big enough to read.
The letters in the books seem to have shrunk.
If you have a good library system, order a few and if you find one that's good enough to be a reference then get your own.

Whatever you get about C will have to fit Arduino. You might want to stick to web learning. Besides, try to copy & paste from a book.

Usually I found Sam's and Que Press to be good in the big thick computer references department.