Go Down

Topic: language advice for newbie programmer (Read 7258 times) previous topic - next topic

troglobyte

I'm starting to get the hang of the arduino programming language.  Or I should say, I can make it do what I want with a lot of research and some trial and error.

Now I'm hooked. I'd like to start writing little apps and down the line, more flushed out programs.  What programming language would you recommend to someone just starting out?  

I work mostly in OS X and Linux and would like to avoid C# and other MS based languages.  Python looks good but seems far removed from the C based code the arduino uses.  C++?  well why not just learn C?  

The stink of it is I've got an upside down pyramid thing going on.  I'm trying to build knowledge on a small foundation.  I'd like to flip it around and learn the fundamentals and build up from there.  But where to begin?  

So, for those of you that have been doing this for awhile, if you had to start over, what language could take you the furthest quickest, and lend itself to building a foundation on witch you could grow into the future?

I appreciate all advice.

Thanks
www.troglobyte.org

Amit

If you want quick feedback, don't want to depend on the Arduino-board, but still stay close to the Arduino environment - I guess you should try Processing. (www.processing.org)


That's the language Wiring was derived from and it'll give you quicker feedback since it's mainly used to do graphic stuff.


Good luck!

Amit

wayoda

Hi,
you are probably starting a war with this question  :) because, as you might not know yet, there is very often a religious aspect concerned with selecting the right programming language.

Here is my advice : I still think that Java is a very good language to start with.
There is an enormous amount of tutorials around for every aspect of programming problems.
If you switch between Linux and Mac you will benefit from the fact that the code runs on both platforms.

And since c++ and C are both very close relatives of the Java langugae, basic concepts learned in Java tutorials will reoccur in the other languages as well.

Eberhard

optique

#3
Jun 14, 2008, 07:07 pm Last Edit: Jun 14, 2008, 07:11 pm by optique Reason: 1
I think Eberhard gives good advice.

And, if language popularity is important to you, then Java is tops!

I dug up the top 5 most popular languages:

  • Java  -  C-like syntax
  • C - C-syntax
  • Visual Basic
  • PHP - (vaguely) C-like syntax
  • C++ C syntax

See source:http://littletutorials.com/2008/05/28/13-reasons-java-die-old-age/
See discussion: http://ask.slashdot.org/article.pl?sid=08/05/29/163253


But personally, I have spent too much time jumping from one language to another to develop any real skill.

Knowing that, I would tend give this advice:

  • Spend 90% of your time learning C, because that is what the Arduino is programmed in.
  • The other 10% of your time could be spent on the other languages.


Note that your interest in Linux (UNIX) make C a natural.
But I might add that Ruby and Python are a lot of fun! Java and C++, both OO, look very interesting, too.

Good Luck,
Steve.

















lilpunk1302

Quote


  • Spend 90% of your time learning C, because that is what the Arduino is programmed in.
  • The other 10% of your time could be spent on the other languages.



For me it's more like 70% PHP 20% Arduino, 10% VB.

troglobyte

Thanks for the input!

Advise from those who've been down this road is really helpful.  I hate to go against any of your ideas but I have to admit to some hesitation about going with Java.  It's one of those hard to quantify things, but I've just had one too many bad experiences with Java apps.  Possibly due to it being many peoples first languages?

Amit - Processing is really neat.  Modifying the Graphing tutorial/example is actually what sparked my desire to really go further and learn something more standardized/ubiquitous.  

I think I'm going to stick with C/C++ for now.  It's portable between mac and nix systems and so closely related to the arduino language that my efforts can serve a dual purpose.  It will also help me avoid what optique pointed out about jumping from language to language and never developing any real skill with a single one.

Of course,  have stated that learning a little of more than one language is probably bad, I have to admit that I still feel a pull towards Python.  I'm just worried that it's structure is so unique that it will slow me down and complicate obtaining a move advanced level of understanding when it comes to arduino code.

Again, thanks for all the input.  I'm going to hit google and collect some reading material for this evening.  

Hope everyones weather is as nice as it is here in Chicago!
www.troglobyte.org

lilpunk1302

The weather's pretty nice out here, we just cut through a 2 week rain drench, now it's sunnay.
(Vancouver, BC, Canada)

melka

Do you have any skills i programming? Bcause if you're just starting and don't know anything yet, you'd better start with the basis : algorithmy. It's not a language, just the "science" behind every language : how to structure your code, how the various conditionnal statements works, etc... If you can't understand the difference between a while and a if loop, start by this ^^

When I was in what is equivalent of a college in the US (Licence Pro, in France), I was one of the few having ever done algorithmy, and it really helped me achieving functionnal & optimized code (Actionscript, at that time).
http://melka.one.free.fr/blog/
http://www.flickr.com/photos/melkaone/

tehboii

Quote
Do you have any skills i programming? Bcause if you're just starting and don't know anything yet, you'd better start with the basis : algorithmy. It's not a language, just the "science" behind every language : how to structure your code, how the various conditionnal statements works, etc... If you can't understand the difference between a while and a if loop, start by this ^^


I (partially) disagree. Learning algorithms is a very important part, but should better be done in the same time of learning a language, because when you're looking to learn "how to do stuff", it can be quite boring to take much time learning the perfect way to do stuff, before learning that it won't work IRL.

So you should consider learning a bit on algorithms, and in the same time and IMHO, study a strictly-typed, formal language, like, as suggested, Java and C++. Those two will open you the door to most modern languages, like PHP.

Since there is no "best" language, you can also give a look from time to time to others, because they all something different which can be interesting for some special uses.

Just stick to common, widely-used languages (which don't mean just C(++) and Java). You probably won't need to try Brainfuck, at least for a beginning ^^
... could use some sleep

follower

Quote
Of course,  have stated that learning a little of more than one language is probably bad, I have to admit that I still feel a pull towards Python.  I'm just worried that it's structure is so unique that it will slow me down and complicate obtaining a move advanced level of understanding when it comes to arduino code.

If you feel a pull towards Python, go learn it, you won't regret it.

--Phil.

tehboii

Automated "censorship" is evil : Read B*r*a*i*n*f*u*c*k instead of Braincrappity smack. It's a funny language.
... could use some sleep

troglobyte

Thanks again for all the input.

I've been spending my evenings with Senior O'reilly extending my C knowledge and absorbing the fundamentals of Python.  I'll be sure to post any code that may be of interest to the community.

www.troglobyte.org

u0421793

It's becoming clear to me that Arduino is lop-sided. The hardware is designed to be very easy to get accustomed to, the projects are very well explained in books and on web sites, etc. It's not difficult to understand how it can all fit together physically. For many people, these electronics hardware skills are new skills -- even learning sewing using conductive thread -- but are presented in a way that a non-technician or non-engineer can accomplish something positive.

Until it comes to the programming. It's pretty much impossible, because almost none of the things that make the physical side so comfortable and gratifying are attended to. The programming language is hideously arcane and impossible to understand in the context of a non-engineer's hobbyist platform. It's frankly the wrong choice. The language should be nothing to do with what real technicians actually use, it should be structured to be very easy to understand, very very easy to modify, and should not produce so many complicated yet meaningless errors, and it should above all produce something that actually works most of the time (even if it doesn't work in the way intended).

The vast majority of the experience of a non-engineer meeting the Arduino Lilypad platform seems to consist of:

  • blink the LED
  • upload a few of the examples, once the hardware has been crocodile clipped or actually sewn together
  • try modifying the examples to make it do something different, at which point
    • the original code stops working
    • anything new you've typed produces a failed dead lifeless pile of what is now expensive hardware with a lot of time invested in it and nothing to show for it
    • more weekends of the same experience
    • despondency, depression, disheartenment
    • give up because nothing works
    • make it blink the LED to prove that it actually still works
    • realise that that is as far as you'll ever get because the programming language is just far too difficult, obtuse, arcane, and badly designed.

  • find some other artistic outlet that actually produces positive results beyond the preset examples.


I'm sure that since I've been reading this board, and much later, when I registered for it, I've noticed a constant stream of people apologising for not being a programmer. Surely that's the point. These little microcontrollers are not for people doing this for a living all day, they're for people who tuck in a few hours of progression of this hobby during a weekend now and then. They're for non-technicians. They're not even for people pretending to be technicians and engineers, which I suspect a lot of the members on here do, and the arduino probably isn't what actual engineers actually use. They'd use something complicated, like the ARM boards and use an equally baffling and complicated programming language, like C. Because they do that sort of thing all day. For their hobbies, they probably do the sort of thing we do for a living, only slowly and badly.

Korman

#13
Nov 04, 2010, 12:57 am Last Edit: Nov 04, 2010, 01:02 am by Korman Reason: 1
Ian,

you're impressions are very wrong on many levels. First, hardware isn't easy, people just think it is. Look at the default answers provided GrumpyMike or other guys with experience: Decoupling, currents, resistor dimensioning etc. Being a software guy I can tell you, the hardware stuff is just as baffling as the software part. Second, the Arduino isn't really built to be easy or user friendly. It's designed to be cheap and simple to interface with. The hardware isn't much more than the Atmel reference design and the software is just a thin veneer over the AVR-GCC and AVR-Glibc. So nothing of the sort you mention.

If you want simple and easy, solutions like Nationals Instruments Labview or Lego Mindstorm are better solutions to isolate the user from engineering complexities.

As a last point, what are people in reality? Look inside all those small appliances and what do you see there? PICs mostly, 8051  and also Atmel processors.

To sum it up, only because it's cheap and easy to get something to blink that doesn't meant that the the product is without complexities. Hiding those is either very limiting or takes a lot of effort, both things the Arduino crew didn't choose to do. For me the product works fine as it is and going by the number of successful project base on it for many others too.

Korman

u0421793

I've just been looking at this "Labview". It looks very interesting. Works on a Mac, which is good, and you can see what's going on, instead of reams of badly typeset Courier, which is also good.

Then I looked at the price. Are you 'king insane? Two and a half grand? Didn't you understand that the Lilypad is essentially a hobbyist platform, which occupies only a tiny percentage of most people's otherwise busy weekends? Labview is out, then.

I really don't see how anything you said can amount to a positive contribution. The syntax is bafflingly bad. It needs to be easy, more forgiving, rather than the strict authoritarian dictatorship that is C, which will only actually work when every single letter of every single word is right, and all the words are the right words. You could be guessing forever.

The design philosophy behind html is a good exemplar (and before any stupid idiots chime in, thinking I'm suggesting programming the Lilypad in html, let me tell you: I'm not suggesting programming the Lilypad in html -- I'm using it as an abstract example of the mode that the designer will find themselves in when exposed to such a technology). When most people started programming web pages, they found their new programming skills could increase at a viable rate of learning because you could look at html examples, try them out, and they'd work. Then you could make modifications, cut and paste bits of two different people's html together, and (this is the important thing) you would still get a web page. You would still get a result. It might not be the result you intended, but the forgiving browser wouldn't simply stop in its tracks and rudely refuse to progress as far as showing you something, while redly and angrily prompting you with a series of red and angry meaningless error code lines.

No, the browser, and html, was forgiving and as such, people actually learned. They weren't discouraged. They tried things, mixed and matched. The true spirit of hacking. This is not present in Arduino, where if you take two programs that perform different functions, and you want to combine them, for the novice, this is just about impossible. Try, and it will fail. Over and over. For months. Getting a new piece of arduino code actually working with the hardware becomes tantamount to winning the lottery, for the novice. Give up. Throw all the arduino hardware in the bin and resign yourself to failure. Find something else to do that actually works, for a happier experience.

Go Up