[Edu-sig] Edu-sig Digest, Vol 22, Issue 26

André Roberge andre.roberge at gmail.com
Sat May 28 16:03:59 CEST 2005


Arthur wrote:
> 
[snip]
> One of the things I think that we all like about Python is the fact that a
> lot of attention has been given to how it looks. 
> 
> Python looks easy.
> 
> So what.

Well, this means that it allows the user to focus on the task at hand, 
rather than making sure that all extra syntactic material is added. 
Allow me to give a non-traditional example.

Richard Pattis' Karel the Robot, designed to teach programming concepts 
using the metaphor of making a robot accomplish tasks.

The simplest meaningful program one can ask Karel to do is to
1. Move (take one step)
2. Turn itself off (to avoid wasting energy :-)

BlueJ is a programming environment designed to help *teach* programming 
in Java.

Here's what the simplest robot program looks like in the BlueJ environment:
==============================
import kareltherobot.*;

public class Example01 implements RobotTask
{
   public void task()
   {
     Robot Karel = new Robot(1, 1, East, 0);
     Karel.move();
     Karel.turnOff() ;
   }
}
==============================

Contrast with two different versions of that program
using a Python-like environment:

====== non-OOP version======
move()
turn_off()
============================

========= OOP version ======
Reeborg = UsedRobot()
Reeborg.move()
Reeborg.turn_off()
============================

I interpret "Python looks easy" to mean that
Python allows one to focus on the task at hand,
with a gentler learning curve.

Easier to learn often translates with
more ambitious projects being attempted ... and completed!

It worked for me :-)

André



More information about the Edu-sig mailing list