User avatar
jzu
Posts: 26
Joined: Mon Aug 01, 2011 8:02 am
Contact: Website

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

Wed Dec 28, 2011 4:54 pm

Search didn't give me relevant results... Still, this is one of the reasons for the RPi's existence.

My son is nearly 15 and I'd like to teach him a bit of programming. I don't think he will become a pro coder, but he should see what happens when you tell a machine to do something. In fact, I'd like to demystify computers.

I have a few ideas since I have practiced quite a few languages. It should be interpreted. Command-line is not a real problem - after all, we old nerds have learned on text-based systems. 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.

ejamie
Posts: 3
Joined: Sat Dec 03, 2011 5:34 am

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

Wed Dec 28, 2011 5:29 pm

There are many options.  Here are a few.

Try Scratch, http://scratch.mit.edu/.  It is a GUI-driven programming environment that is easy for my 12 year old to understand, even when I am not standing over his shoulder.  Also, it has a built-in project sharing capability so you can download and try/modify programs others have developed.  I run scratch on windows, but see this page for running it on Linux: http://info.scratch.mit.edu/Sc.....h_on_Linux

Next, LOGO is an old tool, but still fun for kids.  I found it works well to teach about procedural programming, graphics, functions, and control logic.  I recommend Berkeley Logo which runs on linux: http://www.cs.berkeley.edu/~bh/logo.html

If he is also interested in robotics, you can try Processing, http://processing.org/.  Processing is the programming language used for the Arduino robotics platform, but it can be used for general purpose programming too.  It is available on Linux.  Processing uses Java-like syntax that may take a bit of patience to learn.  But, learning it can be a sort of primer for later Java professional development, if he finds he really enjoys it.

nullstring
Posts: 178
Joined: Sun Oct 02, 2011 3:05 pm

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

Wed Dec 28, 2011 6:06 pm

PHP is a good language to play around with.


Very easy to use.
Rapid development.
Documentation complete and widely available.
C-esk syntax.
GUI via HTML is very easy.


Java is a good language to learn.


Enterprisey and object oriented.
Documentation complete and widely available.
C-esk syntax.
Many applications.

Joules
Posts: 87
Joined: Sun Dec 25, 2011 8:50 pm

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

Wed Dec 28, 2011 7:54 pm

I"ll play devils advocate and say Basic. It"s what I shall teach my nephew to program in for starters, assuming it is available for the Raspi.

achim
Posts: 1
Joined: Wed Dec 28, 2011 7:56 pm

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

Wed Dec 28, 2011 8:26 pm

I propose Python.

it fully fulfils (as requested)


It should be interpreted, IPython is great
really should be very simple to use --> there are very good tutorials around
OO would be nice, in a straightforward and optional incarnation.

It is a quite modern language, currently in top 10 of Tiobe index

I am not sure about low system resources. I use Python for several applications and I never observed any system resource issues. It is definitely less than Java.

As regards graphics, there are plenty of choices available (Qt, GTK bindings) with wider range of features than HTML.

I used Perl in my former life but colleagues convinced me to switch to Python I no longer miss Perl.

I think for script like programming Python today is the best choice.

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

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

Wed Dec 28, 2011 8:32 pm

Not sure why a search didn't bring up anything - there are pages and pages of forum comments on just this subject.
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.

pwhbeck
Posts: 31
Joined: Mon Dec 12, 2011 3:28 am
Contact: Website

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

Wed Dec 28, 2011 8:38 pm

Python.

This recommendation from a 75 year old man who started with IBM 360 assembler in 1963.

phire
Posts: 3
Joined: Thu Dec 29, 2011 8:29 am

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

Thu Dec 29, 2011 8:38 am

Whatever programming language they choose will be constrained by the amount of available disk space on the SSD Card. A full blown Linux installation can easily chomp 15GB of hard-disk space. What I find exciting about the prospect of the Raspberry Pi is the size of the board, has anyone given any consideration to the prospect of Solar Power?

Something the size of an iPhone with a miniature Solar Panel powering it's miniature on board Lithium Ion or what about one that relies on Solar Power and no battery in its entirety.

Can you imagine a hand held device that is powered totally by the Sun!

If they can build a Science Calculator that runs on solar power why not a tiny pocket PC with Bluetooth & Wifi.

BlueClogger
Posts: 34
Joined: Mon Dec 26, 2011 11:01 am

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

Thu Dec 29, 2011 8:56 am

BBC BASIC under RiscOS.  Fast, compact, (fairly) structured (for a non-complex language), well-tested and easy to understand.

alecthegeek
Posts: 38
Joined: Mon Aug 08, 2011 3:11 am
Location: Melbourne, Australia
Contact: Website

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

Thu Dec 29, 2011 8:56 am

Python as mentioned in many other threads. Also my choice for teaching (but I don't have @pwhbeck pedigree -- I only started programming in 1978 using ICL mainframe BASIC)
--
Alec Clews <alec.clews@gmail.com>
http://about.me/alecthegeek

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

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

Thu Dec 29, 2011 9:15 am

phire said:


Whatever programming language they choose will be constrained by the amount of available disk space on the SSD Card. A full blown Linux installation can easily chomp 15GB of hard-disk space. What I find exciting about the prospect of the Raspberry Pi is the size of the board, has anyone given any consideration to the prospect of Solar Power?

Something the size of an iPhone with a miniature Solar Panel powering it's miniature on board Lithium Ion or what about one that relies on Solar Power and no battery in its entirety.

Can you imagine a hand held device that is powered totally by the Sun!

If they can build a Science Calculator that runs on solar power why not a tiny pocket PC with Bluetooth & Wifi.


My alpha board with a 4GB SD cards has load so f languages installed that I used for testing (see wiki for ones I tried). I don't think space will be a problem.

Solar power has been mentioned before - try a search.
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.

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:46 am

Ruby would be my suggestion -- though Python has a great base of education material and would also be a good choice. The benefit of Ruby is that the language itself is very forgiving and extremely 'readable'. There's an app called 'HacketyHack' that you can use to teach Ruby, and it lets you create windows and interfaces too, so it's not just console based hacking. It'll need porting to RaspberryPi, but I'm sure somebody will do that (if it doesn't already build on ARM). Check it out: http://hackety-hack.com/

I'd stay away from Java (won't work on RaspberryPi anyway -- I don't think the Java SDK works on ARM), and C/C++ (those are generally reserved for games programming and operating system stuff these days). I'd also stay away from PHP, unless you want him to make basic web pages (but then Ruby and either Rails or Sinatra would do a better job).

Basic is fine, but there are very few modern basics that let you do exciting (or interesting) stuff, so it might just seem a bit flat. Back in the old days, Basic was fine because computers were simple and text on a screen was just fine. BlitzBasic is the exception that springs to mind (it's aimed as games programming), but it won't work on Raspberry Pi.

There's a weird and wonderful guide to Ruby called Why's Poignant Guide. It goes through some of the basics. A lot of people tell me they found it too 'strange', but I loved it. It's worth taking a look anyway, because it won't cost a penny: http://mislav.uniqpath.com/poignant-guide/

davidgoodenough
Posts: 74
Joined: Wed Sep 21, 2011 11:55 am

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

Thu Dec 29, 2011 10:22 am

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

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?

Thu Dec 29, 2011 10:26 am

C programming language should be an obvious choice, especially since they may hack the kernel and for applications lots of open source projects and libraries are available. Other languages are also nice to develop applications, but you won't be able to play with drivers or the kernel.

wizbit
Posts: 4
Joined: Sun Dec 11, 2011 9:32 pm

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

Thu Dec 29, 2011 10:38 am

Other extensive posts:

http://www.raspberrypi.org/for.....-language/

http://www.raspberrypi.org/for.....ogramming/

I'd suggest looking at those as this info is already fragmented... best not to create yet another thread

Related:

http://www.raspberrypi.org/for.....g-pi-blog/

http://www.raspberrypi.org/for.....ee-course/

http://www.raspberrypi.org/for.....damentals/

... many others... browse in the educational forums for more (don't even need search):

http://www.raspberrypi.org/for.....lications/

User avatar
jzu
Posts: 26
Joined: Mon Aug 01, 2011 8:02 am
Contact: Website

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

Thu Dec 29, 2011 10:38 am

JamesH said:


Not sure why a search didn't bring up anything - there are pages and pages of forum comments on just this subject.



Silly me - you're right. The default search looks in the "Current Forum", and obviously much more came when I selected "All Forums"...

slacer
Posts: 32
Joined: Mon Dec 26, 2011 9:13 am

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

Thu Dec 29, 2011 11:02 am

There is a big bag full of languages to choose from and it really depends on what you want.

- Pascal (freepascal.org supports ARM)

This language is easy to learn and the compiler is very picky about syntax and gives you detailed information about what is wrong with your code. After the first year I would switch to another language like Java, Python, C/C++.

- C - I would not recommend it for starters because it will simply compile and it won't help you to receive a core dump or bus error once you start your first program.

- Java - there is Java ME for embedded devices for ARM, I have never tried it, but if you want to stay with one language from start to finish.

- Basic - Simple for Input->processing->Output. I would prefer a version without line numbers and with support for subroutines.

- Assembler as second language for very small projects, just to show how things work behind the scenes. This would require programming knowledge from either Pascal, C, Basic,...

phire
Posts: 3
Joined: Thu Dec 29, 2011 8:29 am

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

Thu Dec 29, 2011 11:09 am

JamesH said:


My alpha board with a 4GB SD cards has load so f languages installed that I used for testing (see wiki for ones I tried). I don"t think space will be a problem.

Solar power has been mentioned before – try a search.


4GB SSD, so you can load all of the perl CPAN library, the development libraries you need, the whole of debhelper and python IDE with no spacial problems what so ever?!

I"ll stick to using my six HDD and 1TB, as for kids learning to program I did and in microsoft dominated market you find the majority of companies want a JRE Developer but then advertise Jobs for Web-Developer and when you say LAMP stack they look at you as if you've gone mad whilst insisting no, no, no we mean AJAX, JQuery and ASP.NET "oh not PHP, SQL && Apache then!"

Here's one for the kids learn how to program with Obfuscation, then when you release your program, if some other sadistically minded miscreant takes a shine to it, it's worthless without the original source.

Look on the bright side children, you could end up like the previous generation being taught to program on the BBC Acorn Basic Micro and you too years later can will find everything you've learned is now redundant and to boot you'll have some self serving prat in a suit staring down his nose at you going "so what can you tell me about C Sharp?"

Paul_ArtCAM
Posts: 2
Joined: Thu Dec 29, 2011 12:09 pm

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

Thu Dec 29, 2011 12:38 pm

Everything is far too complex today – bloatware!

In 1980 I built a Nascom 1 with 1k EPROM and 1K of RAM and learned Z80 machine code to generate graphics, morse code tones and decode the MSF time signal from Rugby.

Give the kids an ARM debugger that displays all the registers and single steps through instructions. Add calls to control LEDs via the GPIO and they will learn bucketloads, then calls to send GPU instructions, make sounds etc.

Today's high performance professional graphics can only be done by "clever" use of the GPU – understanding the GPU at a low level is mission critical.

There are millions of PCs and notebooks that can do high-level languages already. Its better to use the RPi to learn the low-level principles and control hardware.

-Paul

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

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

Thu Dec 29, 2011 12:44 pm

phire said:


JamesH said:


My alpha board with a 4GB SD cards has load so f languages installed that I used for testing (see wiki for ones I tried). I don"t think space will be a problem.

Solar power has been mentioned before – try a search.


4GB SSD, so you can load all of the perl CPAN library, the development libraries you need, the whole of debhelper and python IDE with no spacial problems what so ever?!

I"ll stick to using my six HDD and 1TB, as for kids learning to program I did and in microsoft dominated market you find the majority of companies want a JRE Developer but then advertise Jobs for Web-Developer and when you say LAMP stack they look at you as if you"ve gone mad whilst insisting no, no, no we mean AJAX, JQuery and ASP.NET "oh not PHP, SQL && Apache then!"

Here"s one for the kids learn how to program with Obfuscation, then when you release your program, if some other sadistically minded miscreant takes a shine to it, it"s worthless without the original source.

Look on the bright side children, you could end up like the previous generation being taught to program on the BBC Acorn Basic Micro and you too years later can will find everything you've learned is now redundant and to boot you'll have some self serving prat in a suit staring down his nose at you going "so what can you tell me about C Sharp?"


I basically have no idea what you are talking about.  If you are saying you need 6 HDD and 1TB drive just to learn programming you are doing it wrong.
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.

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

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

Thu Dec 29, 2011 12:50 pm

Paul_ArtCAM said:


Everything is far too complex today – bloatware!

In 1980 I built a Nascom 1 with 1k EPROM and 1K of RAM and learned Z80 machine code to generate graphics, morse code tones and decode the MSF time signal from Rugby.

Give the kids an ARM debugger that displays all the registers and single steps through instructions. Add calls to control LEDs via the GPIO and they will learn bucketloads, then calls to send GPU instructions, make sounds etc.

Today's high performance professional graphics can only be done by "clever" use of the GPU – understanding the GPU at a low level is mission critical.

There are millions of PCs and notebooks that can do high-level languages already. Its better to use the RPi to learn the low-level principles and control hardware.

-Paul


There is complexity and there is bloatware - they don't necessarily coincide. For example, Windows is complex and bloating. Linux is complex and not bloaty. The Videocore GPU software is mindbogglingly complex, but not bloaty at all.

And today's high end professional graphics don't need to go anywhere near the low level GPU - most people are sensible and use OpenGL/VG - a standard interface that works. It's much easier, and just as fast as this legendary low level access that people, incorrectly, seem to want.

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.
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.

phire
Posts: 3
Joined: Thu Dec 29, 2011 8:29 am

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

Thu Dec 29, 2011 2:21 pm

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!

archanoid
Posts: 2
Joined: Thu Dec 29, 2011 2:40 pm
Contact: Website

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

Thu Dec 29, 2011 2:50 pm

I'll add another endorsement of python. But I'll add that you may want to consider something more lightweight on these boards. I've heard a lot of good things about Lua.

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 3:12 pm

c#

Can use visual studio on a pc to write code to run on raspberry pi, thus giving you the incredibly helpful  intellisence to guide you.

A lot of people recommend python but I think of that as more of a scripting language, and I find it very confusing with the different ways to import modules. I still use it though!

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 3:24 pm

phire said:


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.


This straw man comes up again and again. Yes, you could buy lots of stuff to plug into it. But the fact is that you can get going for about 35 quid from scratch. 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.

Return to “General discussion”