[Python-talk] October meeting topics

Python python at venix.com
Thu Sep 22 13:45:44 EDT 2005

On Thu, 2005-09-22 at 12:46 -0400, Tom Bigford wrote:
> Hi Kent and all ...
> Well, as a teacher, i can certainly relate to the feeling of students 
> not caring. 
> I have to admit though, I am also having problems getting excited about 
> python.  The problem is, nothing has pushed me over the edge from mildly 
> curious to fanatic, as it has (evidently) several in this group.  I can 
> certainly relate to the "...oh no, another language to learn ..." school 
> of thought.  OTOH i am a language junky - Java being my 6th language to 
> use professionaly - and am currently looking for the Next Big Thing to 
> come along in the language world.

You are really asking for a relatively serious document and I do not
have the time, right now, to produce such a document.  Here are some
quick comments.

Java is missing basic functional abilities and has a relatively clumsy
approach to handling objects.  For instance, Python's functional (and
dynamic) abilities allow me to create database table classes on the fly
by inspecting (e.g. with MySQL command 'DESCRIBE <tablename>') tables
and filling in the field names and type info.

To iterate through *ANY* container in Python:
	for thing in container:
		thing.process()		# or maybe process(thing)

in Java (I needed to look it up)
	Iterator it = container.iterator()
	while (it.hasNext()) {
		Object obj = it.next()	// actually you would have some sort of cast here
In Java a hashmap is *not* a container and does not have an iterator.
You need to do
	Iterator it = hashmap.keys().iterator()
(That may be obvious to real Java guy, but I spent a long time wading
through the documentation before I found how to do that.  I was trying
to figure out how hashmaps lost their iterator method?)

Initializing lists and hashmaps in Java is very clumsy.  

The mixing of Integer objects (allocated from the heap) and int fields
(allocated from the stack) creates confusion and complications -
admittedly at some gain in performance.

When forced to write code in Java I feel like I am in a potato sack
race, hindered by a set of artificial constraints.

Here are a couple of links that could be helpful:

A quick intro with simple coding examples.

The true confession of yet another Python zealot.

Lloyd Kvam
Venix Corp

More information about the Python-talk mailing list