[Tutor] understanding classes

Magnus Lycka magnus@thinkware.se
Thu, 15 Aug 2002 01:11:16 +0200


At 17:56 2002-08-14 -0400, Lance E Sloan wrote:
>I've been asked to explain Python, in a nutshell, as it were, to others in=
=20
>my workgroup, which are primarily Java and/or Perl developers.  Is my work=
=20
>cut out for me or what?

It don't think they will get stuck on "this". As you can read
in http://www.python.org/doc/essays/foreword.html the main
influences for Python was ABC and Modula-3. If memory serves
me right, "self" comes from Modula-3. There is even a programming
language called "Self", so that word should not come as a
surprise.

Tim Peters' "poem" is much more recent than the self
convention, so obviously "import this" is a very recent
"feature". And remember, Python started in 1989, long
before Java. But it wasn't backed by one of the worlds
largest computer companies.

For the Perl hackers you can say that it's briefly Perl
with most $, @, { and } removed, with proper intentation
required, and they can forget all traces of sed and awk
syntax, as well as backward constructions such as "unless"
and putting the block before if and the condition after.
They might find it boring to write, but probably much less
stressful to understand if they need to change someone
elses code (or something they wrote more than a few months
ago).

The Perl OO model is based on Python, but in the Python
incarnation it has sane names, and isn't bolted on in version
five.

Actually, Tim's poem has a lot of points (even if it tries
to be a little funny as well.)

Why don't you run Guido's excellent presentation for them.
As a programmer you should see the virtue in reuse:
http://www.python.org/doc/essays/ppt/lwnyc2002/intro22.ppt

If you understand all in this intro, you won't have any problems.

There is also some issues for Java -> Python transition in
http://www.python.org/doc/essays/ppt/hp-training/sld022.htm
I think this presentation might be a bit tough for complete
beginners though.

Obviously these kinds of presentations are only brief summaries
of what one might say in such a presentation. Get back if you
plan to use one of there but are lost about what some particular
thing means.

At http://www.bagley.org/~doug/shootout/ you can find a lot of
examples of code written in different languages. Most of the Python
code is neither very pretty, nor very clever, but at least you
can show some examples of Perl, Python and Java used for the same
purpose. My general problem with those programs is that they don't
show the great strengths of Python, such as the standard libraries
for internet etc. You can write a complete web server in just a few
lines of code. Or an XML/RPC-server. Change two lines of code and
it's a threading version. Etc.

Some testimonials can be found at
http://www.thinkware.se/cgi-bin/thinki.cgi/PythonQuotes


Good Luck!

/Magnus



--=20
Magnus Lyck=E5, Thinkware AB
=C4lvans v=E4g 99, SE-907 50 UME=C5
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se