[Tutor] Python vs. VB

Martijn Faassen m.faassen@vet.uu.nl
Tue, 07 Sep 1999 18:51:58 +0200


> Alexandre Passos wrote:
> 
> I've tried the working model of VB and noticed that Python is much
> different.
> Python is text-oriented and VB is object/event oriented.

Actually *Python* is the object oriented programming language and VB
isn't. VB can have objects, but they can't inherit from each other as
far as I know, which is part of the definition of 'object oriented'.
That's why VB is sometimes called 'object based'. In VB you tend to deal
a lot with user interface objects that can receive events, and you
attach code to those events. I think it's possible to develop your own
VB objects as well (within limitations), but in general that's obscured
from view; the whole paradigm is that you build a user interface and do
your stuff in the events. Your mind gets focused on GUI building, and
distracted from actually programming.

This paradigm is fine for short programs, but for larger projects it
becomes very limiting; you aren't able to organize your code as easily,
and good code organisation (and abstraction of things) is one of the
most important things in programming.

In Python, there's no default way to construct a GUI, no default GUI
builder, no default object/event system. But, you can work with such
systems in Python; although it is harder to get something going with
Python than with VB, if it includes user interface things. Once you have
it going in Python however, you can organize your code a lot better than
in VB, as Python as a language is much nicer.

VB is not just a programming language, but an environment to develop
software in -- it includes an editor and GUI builder, among other
things. Python is just the programming language itself -- you get
external editors, and external GUI builders (though not many Python GUI
builders exist yet). You can pick and choose your own things. This makes
Python more flexible and open.

That said, it would be nice to have a Python GUI development environment
as well. It may make it more difficult to organize code, just like VB
does now, but Python is a more open and flexible language, so I think
we'll survive that :) It would be handy to quickly whip up a nice GUI
app, and it would be easier on newbies as well (who tend to like to see
quick results). There are various projects that can provide the parts
for such an environment bandied around right now, so perhaps in a while
we'll see a 'Visual Python'.

Regards,

Martijn