Python for RAD (was: [Tutor] Re: q about method(self))

alan.gauld@bt.com alan.gauld@bt.com
Mon, 2 Sep 2002 17:58:44 +0100


> Yet, at the same time Python is often described as a useful 
> environment for rapid application design, 

RAD = Rapid Application Development.
Design is a mental process and rarely rapid! :-)

> so that a model can be tested quickly 
> without dealing with these sorts of inconveniences, 

This is my only use for Python at work. I test out design 
ideas aimed at Java or C++(and occasionally COBOL!) in Python.

If its JAVA it will entail classes - sometimes objects too!
If its C++ it could be classes, objects or neither - just like Python!
If its COBOL its definitely not OO in any shape or form.

> question:  If you are eventually planning to migrate code to, 
> say Java is it unwise to take the easier route of writing 
> functions to do some work that would normally be implemented 
> [more tediously] using a class?

It depends. The prototyping may be more interested in how 
an integration technology works (Microsoft COM or CORBA say) 
than in prototyping the structure of the design. So writing 
a few quick n' dirty functions to create a COM interface 
and communicatecwith it, examining return values is all 
you need - I sometimes get all I need from the >>> prompt....

If you want to compare class heirarchies - flat vv wide 
etc - then obviously you use the proposed designs for 
the low level language.

Its not usual (for me at least) to implement a whole Java
application in Python, its usually just the tricky bits 
I'm interested in.

> I would think so, since this would violate the very thing which is 
> being tested -- the design/model of the application.  

If thats what you are prototyping. But IME its more likely to be
a mechanism used in the design - a technoique for storing 
data - dictionary vv file vv array etc. Or an integration 
technique. Or maybe a foreign object model - like an XML DOM say.

You can play with these ideas in Python till you understand 
how they really work then tackle the much more time 
consuming Java/C++ code with confidence.

> PS:  I know that there are some strong feelings about different 
> methodologies (including one guy on Slashdot who apparently 
> devotes his life to combating the popularity of OO: 

Anyone who can't argue both for and against any concept 
doesn't really understand it! OO is great for some things. 
FP is good for others. Hardcore assembler is best for still 
others. The mark of a true craftsman is knowing how to use 
a variety of tools - and when to use which....

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld