jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28358
Joined: Sat Jul 30, 2011 7:41 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 3:30 pm

phire said:


JamesH said:


There are million of PC"s out there that, as you say, are perfectly capable of being used to learn programming. They are already owned by people who can afford them. The Raspi is designed for people who cannot afford them, which is a LOT of people. It also safer for schools/parent who WONT let their students program on the PC"s because they may break them.

Oh, and give people an Arm debugger (which will be on the Pi Btw), an you will put more people off than you help. Too complex, too fast.


If they break a PC programming then aren"t they the ones doing something wrong? As to affording a Machine, I got mine out of someone else rubbish, the guy handed it to me saying "here I was trying to build a super computer!" the only reason he failed was the PSU was faulty. AMD Athlon/Opteron 64 and all of the part"s that compose this machine apart from the SATA disks where composed from re-cycled parts, including the WiFi which I built myself using an old Zytel router and a US Robotics PCI to mini-PCI Bridge.

You would be amazed what people throw in the trash on a daily basis I"ve seen intel Xeon"s with hyper-threading in the trash all because the graphics card fan has shorted out and rather than try to repair it, they"ve estimated it would cost too much and thrown it away. I"ve even rebuilt an original Sony PS2 just so I could load Black Rhino Linux onto it"s MIPS processor. Most recycled stuff ends up in China, an they hit you sometimes with the argument about data protection, but you can always offer the rubbish man a tenner to look the other way, whilst you salvage the parts you want.

What someone else has on their HDD is of no interest to me, but not so for the Chinese we threw out a PC once that went to the local dump, it made its way to china and lo and behold the financial records with credit card statements where being used and cloned for fraud. The Bank had the common decency to tell us that much when they tried to confirm the sale of a three piece suite in Canada!

Whilst it"s admirable that the Rasp_Pi unit will only cost around a tenner to buy, you then have to look at the other costs involved which will appeal only to enthusiasts, USB Keyboard + £50, HDMI Monitor (not cheap), 32GB SSD Card etc, etc. Cumulative cost"s in total to get the working Box you desired in the first place.

Not to detract from the experience I am sure there will be plenty of third world buyers queuing up, after all guided missile chips cost an arm and a leg!


You built you own PC bits from recycled materials. Therefore you are quite obviously not the target market for the Raspi. The vast majority of people do not build their own PC's. They buy one, then forbit junior from doing anything on it that might break it. It's not even possible for machines that then go in to schools - as they need to be electrically tested which makes much more expensive than 'scrap', and when you do have decent school pc's they are locked down, for 'breakage' reasons.

The Raspi is SO cheap none of this matters - and they are pretty much unbreakable inb normal use - you most you will need to do is reformat the SD card and start again. Oh, and your prices are way out - a USB mouse keyboard combo shouldn't cost > £10. You can plug a raspi in to a HDMI telly (many homes now have those). 4GB card, £5. You don't need 32GB.

Anyway, time will tell. (and search the forum for even more stuff about this - even the start of this thread)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

spock
Posts: 227
Joined: Sun Oct 02, 2011 10:33 am

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 3:58 pm

some of the suggestions (not only in this thread but also in the other ones about programming languages) are really weird. have you even read the original poster's requirements?

php !? (ok, theoretically it can also be used like other dynamic languages but then it's even uglier than it already is for web development)

using c# on windows because of intellisense !? why use the raspberry pi at all then?

and without 6HDs and 1TB of libraries and documentation... yeah, forget it!

TheLaw
Posts: 13
Joined: Sun Oct 16, 2011 7:27 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 7:31 pm

Spock, I think visual c# fits the original posters requirements very well, and mono will allow programs to run on raspberry pi. And you don't have to use visual studio at all. I don't know what you mean by 6HDs and 1TB of libraries.

I suppose I wouldn't really teach using a raspberry pi alone, and I don't think many people will. I do think it will be wildly popular and successful for other purposes though.

Miroslav-Stimac
Posts: 3
Joined: Thu Dec 29, 2011 6:54 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 7:44 pm

I am a C# and Visual BASIC .NET developer and I really love the .NET Framework, but I think that it may be too big and too complicated for a beginner. For a beginner there are too many classes in the .NET Framework.

Maybe Microsoft Small Basic would be suitable?

It is based on Microsoft .NET, but very simple and it is designed for people who want to begin learning programming. Take a look on the Microsoft website. You can download it there and find some tutorials.

Best wishes,

Miroslav Stimac

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28358
Joined: Sat Jul 30, 2011 7:41 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 7:46 pm

TheLaw said:


Spock, I think visual c# fits the original posters requirements very well, and mono will allow programs to run on raspberry pi. And you don't have to use visual studio at all. I don't know what you mean by 6HDs and 1TB of libraries.

I suppose I wouldn't really teach using a raspberry pi alone, and I don't think many people will. I do think it will be wildly popular and successful for other purposes though.


Mono just about works I suppose, but I think you will lose a lot of performance using C# over something like Python, and certainly over C.

And I am interested to know why you think you wouldn't teach with a Raspi alone?

The 6HDs/1TB disk was a reference to an earlier and odder post)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

TheLaw
Posts: 13
Joined: Sun Oct 16, 2011 7:27 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 8:08 pm

JamesH said:


Mono just about works I suppose, but I think you will lose a lot of performance using C# over something like Python, and certainly over C.

And I am interested to know why you think you wouldn't teach with a Raspi alone?


James, more or less only because visual studio gives such good design-time help and guidance.

I suppose that anything I say about c# could apply to Java, but does the raspberry pi run java apps? I don't know if we have a clear answer on that one.

To the OP, if you wanted to go a little bit eccentric you could give fortran a try. Yes, that is weird, but it is very simple and well incorporated into linux.

to
Posts: 11
Joined: Tue Dec 27, 2011 4:57 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 8:37 pm

Personally, I would probably use Perl. Perl is easy to begin with (no magic starting-methods except for the hash-bang at the top) and you can really tell what each datatype you expect back just by looking at the prefix. You don't have to tear your hair because you pressed tab instead of space and it's very easy to run other programs in Perl (even supports backticks), so the kid can do stuff really quickly. I write Java for a living, but almost every day I miss the map {} and grep {}.

That said, any language would probably work as long as there's a carrot, either coolness (blinking a diode/make screen do fun things etc)  or usefulness (sorting music collection). At least that's how I kept my interest in programming alive while 'programming' html in the local variant of ICT-courses.

Oh, and while I've heard people on this forum singing the praise of how good it is that Java probably can't run on Pi and no more frameworks, there's no point in reinventing the wheel. When (s)he gets better, teach the kid how to handle the package manager (maven, cpan, pip or just apt-get/pacman).

Tomo2k
Posts: 127
Joined: Mon Dec 19, 2011 10:00 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 8:39 pm

Almost all IDEs offer help equivalent to Intellisense - and the Visual Studio IDE is not helpful once you're trying to crosscompile (it will but it's painful to configure) and won't run outside of Windows.

There are plenty of good cross-platform IDEs outside of Visual Studio. I use Qt Creator, other people like Eclipse, etc etc. I don't know how well they will run on the Raspberry yet.

It would be interesting to know which IDEs have been tried out so far.

Spikey
Posts: 7
Joined: Sat Nov 19, 2011 7:52 am

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 8:55 pm

I've been looking at pyGame lately - I think this would be a great place for kids to start, as it offers more-or-less instant gratification, with lots of examples they can adapt to their own purposes.

Also, they start to learn OO development, which of course is very powerful.

BTW, I'm also very fond of perl - that's my day job at the moment and it is very powerful, but a bit arcane and unreadable at times.

adrian.oconnor
Posts: 30
Joined: Mon Nov 14, 2011 9:51 pm
Contact: Website

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 9:00 pm

davidgoodenough said:


It is simply untrue to say that the Java JDK does not work on ARM.  I do not yet have a Raspberry Pi to try, but I do have a BeagleBone (which uses a TI ARM chip), and yesterday I installed Debian sid on it along with OpenJDK-7 and ran a Java application - which worked.  As of Java 7 OpenJDK is the official JDK.

So please stop peddling this misinformation.

David


In that case I am sorry -- I didn't realise OpenJDK was running so well on ARM. That's actually great news. I knew there were ARM versions of Java, I just didn't know the full shebang was so eminently 'do-able' these days. I do like Java. I'm not sure I'd want to use it in 128MB RAM though. Or try and use it to teach programming to a barely interested teenager.

Anyway, coming back to this thread it all seems to have gone a bit pear shaped. First of all, Raspberry Pi is the perfect computer to learn on, if all you had before was an Xbox or over-used family PC.

Secondly, I really wouldn't recommend Java, C# (or anything remotely related to Microsoft), because those are for business types, and won't hold a youngster's interest. There's nothing special about Visual Studio compared to any other system, and it won't ever run on a Raspberry Pi anyway.

ASM is a big no-no -- you've got to be REALLY eager to want to go that route these days, and it doesn't sound like OP's target is. ASM was the language of choice for programmers in 1980. The world has moved on.

I'd still recommend Python or Ruby. Hopefully the SDL libraries will work out of the box, and that'll give you an easy way to hook up sound and graphics. If Hackety Hack works, that will also make things easier. HH is a Ruby thing that tries to teach programming interactively.

As a bonus, I'd also recommend you get an Arduino Uno, some parts and the Arduino book. It's really very good, and it'll open your eyes to how most toys and consumer electronics are built these days.

spock
Posts: 227
Joined: Sun Oct 02, 2011 10:33 am

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 9:02 pm

Tomo2k said:


It would be interesting to know which IDEs have been tried out so far.


yes, i also find the IDE question more interesting than the language question.

what IDEs are popular on linux (for which language)? and which ones are lightweight enough for the raspberry pi?

comet
Posts: 1
Joined: Thu Dec 29, 2011 9:05 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 9:16 pm

I agree with Python and PHP. The R Pi would make a fantastic sandbox LAMP server. Not to mention you can cover many grounds when teaching web development. Between creating databases and scripting you have a win-win scenario. HTML, CSS, PHP, and some jQuery, are all excellent, practical choices and the application purposes are endless. It could also inspire people from around the world to look for jobs in web development or perhaps even start their own businesses.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28358
Joined: Sat Jul 30, 2011 7:41 pm

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 11:09 pm

spock said:


Tomo2k said:


It would be interesting to know which IDEs have been tried out so far.


yes, i also find the IDE question more interesting than the language question.

what IDEs are popular on linux (for which language)? and which ones are lightweight enough for the raspberry pi?


I have a feeling that only very VERY lightweight IDE's will work. Although for Videocore work I use Ultraedit and a command line cross compiler with makefiles on a WinXP PC….!

Used Eclipse in the past, that's OK, but much too heavy, and Visual Studio wont work on the Raspi anyway.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
scep
Posts: 1062
Joined: Sun Nov 20, 2011 8:53 am

Re: Which language would you choose to teach programming on the RPi?

Thu Dec 29, 2011 11:48 pm

Four reasons for Python:


It meets all your requirements (well, maybe not the "very simple" graphics, but easy enough).
There will be a free (third party) user guide available when the educational version of the RasPi comes out next year. It will teach Python.
It was the first language that I have learned in a long time that made me smile. (Not sure if that is a "sensible" reason to recommend it, but it's definitely a good one )
The "Pi" in Raspberry Pi was originally a nod to Python - so it should be compulsory

User avatar
cnxsoft
Posts: 191
Joined: Sat Oct 15, 2011 2:33 pm
Location: Chiang Mai, Thailand
Contact: Website

Re: Which language would you choose to teach programming on the RPi?

Fri Dec 30, 2011 1:30 am

scep said:

Here is what you need:

Pi A (incl): £23

Mouse+keyboard: £6

4Gb SD card: £4

HDMI/composite cable: £2

A TV: typically free with every house

This is all you need to start programming and doing lots of other cool stuff. This is the whole point of the Raspberry Pi.


If you use another computer and connect via ssh, you may not even need the TV.

If you use the R-Pi as both the build machine and target (implyng it is the only machine you have), it might be difficult to use the TV connected via the composite output, unless you use large fonts.

spock
Posts: 227
Joined: Sun Oct 02, 2011 10:33 am

Re: Which language would you choose to teach programming on the RPi?

Fri Dec 30, 2011 12:08 pm

scep said:


It meets all your requirements (well, maybe not the "very simple" graphics, but easy enough).


the drawing functions of pygame are very easy to use. for the first simple experiments you also don't really need any of the other pygame stuff (event loop,…).

gimliflea
Posts: 76
Joined: Fri Nov 18, 2011 4:14 pm

Re: Which language would you choose to teach programming on the RPi?

Fri Dec 30, 2011 4:56 pm

I run the IDLE ide on my ancient laptop with Ubuntu LXDE it is very lightweight and a doddle to set up and very easy to use - (almost certain to work out of the box on R-PI). I am still struggling with setting up eclipse though and its heavier.

I go for python and idle as closest to the buzz of old style basic. But python has the advantage of being a very powerful front end to C which is probably the most widely used system programming language. With those 2 under your belt you can get stuck into asm on a PIC or somesuch. Although I am one of those who loves the directness of asm and mostly used it professionally I would not introduce a newby to arm asm although I am trying to get my head round it.

I think a lot of people on these threads are arguing from the past. My first programming language was cobol - does it still exist? But I still learnt a very good programming lesson from it which was to get your data division right and your procedure division takes care of itself.

People will learn whatever language they start with - if they don't they probably wont become programmers anyway imo.

fatjonnie
Posts: 4
Joined: Mon Dec 26, 2011 11:23 am

Re: Which language would you choose to teach programming on the RPi?

Fri Dec 30, 2011 5:38 pm

It has to be C as far as I'm concerned - its small, fast and as close to the hardware as you need to get. Learn the basics of C and virtually all other languages fall into place.

Fatjonnie

(for reference, I started with Algol a long long time ago)

TheLaw
Posts: 13
Joined: Sun Oct 16, 2011 7:27 pm

Re: Which language would you choose to teach programming on the RPi?

Fri Dec 30, 2011 6:06 pm

I think jonnie is probably right, in the end. C is not interpreted as the OP wanted but it is quite satisfying to compile and link a program, and very educational. This is well integrated into linux and you can learn to write a make file to automate it etc. Very useful stuff to learn.

fatjonnie said:


It has to be C as far as I'm concerned - its small, fast and as close to the hardware as you need to get. Learn the basics of C and virtually all other languages fall into place.

Fatjonnie

(for reference, I started with Algol a long long time ago)


nichobb
Posts: 82
Joined: Sat Nov 19, 2011 10:34 am

Re: Which language would you choose to teach programming on the RPi?

Fri Dec 30, 2011 6:40 pm

Dear OP,
I"ve been looking for appropriate languages as well since start of the holidays and have been hanging around these kind of posts.

Of the ones I"ve looked at and used (vb, c#, php, python) I would add my voice to the python voters.

It"s not a language overly burdened by syntax so is easy to read, it shares the basic structure of most modern languages, it"ll work on most computers (I"m using it on an android tablet) and most importantly there is a set of very good resources out there for beginners.

The official site has a good set of links:
http://www.wiki.python.org/moi.....rogrammers
of which I quite liked;
http://www.inventwithpython.com/
http://www.hetland.org/writing.....cking.html

Hope this helps.

flickern0ise
Posts: 2
Joined: Fri Dec 30, 2011 9:36 pm

Re: Which language would you choose to teach programming on the RPi?

Fri Dec 30, 2011 11:39 pm

may I suggest Javascript as a quick start

(with a little bit of HTML to construct the page the Javascript lives in)

reasons:

1. type in code in any text editor

2. immediate results can be seen in any broswer that supports it.

( recent browsers have quite good js debuggers and color coding)

3. 'canvas' for simple graphics (recent browsers)

4. can start with procedural programming and move on to OOP

5. it''s a curly brace langauge.

It will give a basic idea of what  programming involves without being

too scary, and with nothing to install or download (once you have a recent browser)

it's 'making something out of nothing'

You can download js libraries (e.g. jQuery) to do very clever stuff even though your code can remain quite simple.

spock
Posts: 227
Joined: Sun Oct 02, 2011 10:33 am

Re: Which language would you choose to teach programming on the RPi?

Sat Dec 31, 2011 12:29 am

javascript isn't that bad (even with its warts like automatic semikolon insertion, weak typing traps, too many confusing null types,...) but with javascript you have to learn several things at once at the beginning (some html + some css will be needed too) and it's the only language that comes to my mind that uses prototypes instead of classes for OO.

papacarpenter
Posts: 1
Joined: Sat Dec 24, 2011 8:48 pm

Re: Which language would you choose to teach programming on the RPi?

Sat Dec 31, 2011 4:23 am

jzu said:

Easy graphics are a must, really should be very simple to use... as well as system resources. OO would be nice, in a straightforward and optional incarnation.

Any ideas appreciated... and, is my list of requirements exhaustive? I don't think so, so please contribute.


I'd highly recommend Python, and for easy graphics: from turtle import *

I have taught math to elementary school kids (3rd - 8th) using several languages over the years and Python is far and away the easiest and most rewarding. Just before vacation, I introduced Python w/ turtle graphics to 4th graders (for about 50 min.) and got groans when they had to out for recess!

My upper graders write their own function graphing utility, their own equation solver (systems of linear equations, using elementary row operations), and many explorations in number theory. I use Mac, Windows XP & 7, and Linux machines and they barely notice the difference.

My goal is teaching mathematics, and Python 'gets in the way' less than any other language we've used. It seems 'natural' and requires much less error-producing punctuation/formatting than other languages. It utilizes oop, but can be handled in more of a procedural manner if you wish (& I do). Some just use it to play and explore stuff in math, others use it as a 'gateway' to other languages. One kid went from Python (in 8th grade) to lead Java programmer for his high school competitive Robotics Team in a year - and they placed Nationally.

Return to “General discussion”