[Tutor] Is Python suitable for my project?

samus samus@feudalkingdoms.tzo.org
Sun, 18 Jul 1999 22:54:31 -0400


>Now I'm planning to develop a new version from scratch. I like
>Visual Basic because it is easy to program with and you can get
>what you want fast. But with my application I got to the limits of
>this programming environment. I had to use thousands of nasty
>tricks to overcome them, and that resulted in a loss of productivity
>and made the code harder to debug, modify and maintain.

Modularity is key to large projects.  In the case of OOP its a mater of
keeping your objects as independent of each other as possible.  Generic is
good.  Then you inherit from those or write specialized wrappers to do the
special case stuff.

>programming, but I have never undertaken a serious project with
>this paradigm. I come from the old structured-programming school...

Get aquainted with it.  Once you get into it its hard to think of writing
software any other way.

>To use any of the languages I already know for my project would
>require too much time. The application I need to develop doesn't
>need any low-level code, so using Pascal or C would be a waste of
>power. C++ is just a modified version of C. This time I would like to
>try the real object-oriented programming. Python springs to mind,
>and I've been reading the introductory course and so far I like what
>I've seen. I think it is a good compromise between programming
>power and productivity.

I have so far enjoyed Python best for automating tasks like system
administration and acting as a support or glue language.  If you plan on
sticking to windows then I would suggest learning about how to do COM
objects.  VB is a decent enough way to start to get a feel of how it works.
The MSDN help sections give nice overviews.  Though I hate that html help
interface.  I'm not sure that I reccomend doing a whole application on
windows in Python yet.  The graphical part will take longer than VB b/c
there isn't really any RAD tool for gui design with Python.  WxPython so far
seems to be the best gui toolkit for python.  Its cross platform with a
native look in each supported platform.  It also doesn't take the least
common denominator of the platforms it actually will add what is missing to
each platform to make things as even as possible.  There is an MFC wrapper
that comes with the win32 python distrobution.  The editor Pythonwin serves
as an IDE and an example of how to do it.

So what I would probably do in your shoes is design out my app with object
oriented principles as much as possible and then use the language that is
easiest for me (in my case VB for others C++ on the backside and VB on the
front).  I would think of the app as more of a toolkit that has a pretty
face.  All the while keeping in mind about how you can embed a scripting
language (Python) in to it to automate repetive tasks.  On win32 if you use
COM you can easily embed any scripting language ala VBA by the use of the
active scripting control.  The debugging pretty much blows but its real easy
to setup the interface between your program and a script.  You can find info
about it on MS's website by searching for VBScript.  I've found this method
to be an excellent way of extending my apps and to easily allow me to switch
out the way things work in the program.  This would be handy if your dad has
a friend that would like the program but he does things slightly different.

Anyway sorry to ramble.  I hope I didn't come off as being an MSZombie.  My
first preference is Linux but at work the market has so far demanded
windows. I have had to appease the bill collectors with a job working with
MS tools while secretly at night plotting world domination through free
software. ;-)

-Sam