OT - Re: GPL Java

Michael Torrie torriem at chem.byu.edu
Thu Nov 9 21:59:06 MST 2006

On Thu, 2006-11-09 at 20:03 -0800, Ross Werner wrote:
> I see it as being the difference between object-oriented programming and  
> procedural program. If you're in a procedural world, you're going to be  
> dominated by verbs. If you're in an object-oriented world, you're going to  
> be dominated by nouns. Ends up being a matter of taste, IMO. But I doubt  
> you could find an object-oriented language that couldn't have most of the  
> same said about it (except for the verbosity ... Java is *definitely*  
> verbose, and again, non disputandum ... I for some strange reason happen  
> to like it).

Python has an extensive library that contains a lot object-oriented
stuff.  And python libraries are not quite that bad.  The closest is
Twisted, which does have a lot of static factory objects.

That's one thing I do like about python.  It's object-oriented through
and through, but because it supports what C# would call delegates (all
things are objects, even functions and anonymous functions), you can use
a procedural style as well as mix in object-oriented paradigms as the
need arises.  I'm not restricted in any way to one paradigm or the
other.  No need for static classes that wrap one or two static
functions.  No need to have special listener classes to receive events.

Python's biggest weakness for me is the type inference.  It works great
except when you're presented with a function about which you know
nothing (and say there's no doctag):

def myfunc(file,size,etc)

So what is a file anyway?  Size is probably a number, likely an integer.
But there's no way to know except look at what someone else has done or
just try and see what exceptions you get.  Duck typing works good for
the runtime, but not for the programmer who's just importing your
library.  I've found myself having to dig through the source code for
various modules to see exactly what the function or method is expected.

> 	~ Ross
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */

More information about the PLUG mailing list