[Tutor] New to programming

Remco Gerlich scarblac@pino.selwerd.nl
Mon, 21 May 2001 18:22:57 +0200


On  0, Patrick Kirk <patrick@kirks.net> wrote:
> Without starting an advocacy thread, why is Python so well spoken of as a
> first language?  Obviously knowing what makes it good makes learning it even
> more useful...

Some reasons:

- Python is fun to program in.

- It's a very clear language. Easy to read. Using indentation for block
  structure and often using words where other languages use punctuation marks
  makes it clear, even when complicated things are happening. Code is read
  much more often than it is written. This is very important.

- It scales well to very small problems. As you noted, writing "Hello World"
  is 1 line that doesn't take much explaining. In Java it would be something
  like
  
  class helloworld {
     public static void main(String args[]) {
        System.out.println("Hello world!")
     }
  }
  
  Look at all that cruft that has to explained to a newbie ("public static
  void main"? Huh?) even though it's not relevant to printing hello world.
  
- With those two combined, it's easy to teach someone *how to program*, 
  instead of teaching them how to program *in language x*. The syntactic
  cruft isn't relevant to programming in general.

- The interactive interpreter is ideal for trying things out.

- What sort of thing is a newbie likely to want to program? Make a few
  scripts for moving files around? Get mail from a mailbox? Automate something
  with Word? Generate HTML from some text files for a webpage? Make a small
  game with a GUI? For all of that, Python is an excellent choice.

- Python is actually very useful. You can do a lot more with it than make
  small beginners' programs.
  
- Python has a Tutor list and a cool community in general ;-)


Python isn't perfect - it's pretty slow, I wouldn't use it for low level
things like device drivers, you'll be spoiled if you are ever forced to use
another language - but that's not that important for a beginner :).

So in my opinion no other language comes close for a beginners' language.
That said, it doesn't hurt at all to try to learn a few (like Alan's
tutorial, it also shows examples in Tcl and BASIC - it's the idea that's
important, not the specific incantation).

-- 
Remco Gerlich