Python vs .Net

Greg Brunet gbrunet at nospamsempersoft.com
Mon Jan 6 00:44:20 EST 2003


I've been checking out Python for a month or so after using VB for many
years, and having just completed a 4 month VB.NET project.  Here's a few
observations that I have:

- VB.NET (as well as C##) are/can be very strongly statically typed -
even more so than VB6.  I'm still trying to determine if I like a
strongly _dynamically_ typed language like Python.  I'm having a hard
time understanding why it's not better to know at compile time that
['foo' + 5] is an exception.  If I have to wait until runtime, then I
would think that I need to be writing LOTS more error checking code at
all my function entry points, whereas with strong static typing, I can
catch all this at compile time.  In my VB.NET project, I even took the
extra step of turning on
"Option Strict On" (in addition to "Option Explicit On" which I always
used in VB6).  (Even though I consider this combination "Option Anal",
my experience has been that it helps ensure that explicitly convert all
data types appropriately.)

- In order to write similar programs to VB6/.NET, I've been looking at
wxPython for the GUI, and wxGlade, PythonCard, and Boa Constructor as
editors / GUI designers.  The VB environments still blow the others
away, though I think that Boa should certainly look very familier to any
Delphi (and now .NET) developers.  There are certainly rough edges on
all these tools, though I have to admit to quite a few extra hours
coming up to speed with the differences between VB6 and .NET WinForms.
I do like many of the changes in WinForms, but it still takes getting
used to.

- I haven't written a big enough Python test program to compare
size,complexity, & performance with VB6 or .NET.  It appears that you'll
have to manage a fair amount of lower level details than you need to be
concerned with in VB.  I think that reducing this is one of the intents
of PythonCard.

- In VB6 (and earlier) it seems that data bound controls had gotten a
bad name for themselves, and a lot of folks ended up recommending that
you NOT bind controls, but move information in & out via code.  It seems
that Microsoft has made a large push to make WinForms databound 'ready
for prime time'.  ...And for good reason - I think that many folks
consider it essential in order to consider a tool to be a RAD (Rapid
Application Development) tool.  Unfortunately, after wrestling with this
in my project, I ended up removing the binding for my main data entry
form.  There were just too many problems with it (primarily in the area
of cascading events involving related fields - it became easier to
unbind the fields).  Bound controls can still be valuable in simpler
situations, and especially with controls like grids, so I haven't given
up on them completely.

- The large and relatively robust set of controls available to VB
developers is probably the biggest issue IMHO.  A data bound grid is
essential to database application developers, in order to display
records to browse & edit.  There are many such grids available (I'm
partial to the TrueGrid / Component One product) for VB, but it seems
that you'd have to write all of the code yourself to do this with
wxGrid.  There are some neat UI widgets in wxPython (and in some of the
other GUI frameworks), but they seem to be way behind in databound
controls.

- I'm still coming to grips with the ADO.NET model, but it seems very
powerful.  The change from RecordSets to Datasets (what I think of as a
local (disconnected) copy of the desired elements of a database), and
the ease of resyncing the information with the database is awesome.
Even better is another Component One tool: DataObjects which extends the
model even further.  This area may end up being even a bigger benefit to
developing database apps than databound controls, so it may be another
key edge for .NET

- It may be that I am too far gone to be able to 'think Pythonically',
but, at least at this time, it still seems to be quite a bit easier to
develop a database app in VB6 or .NET than in Python.  I'll still be
investigating Python, and may even be able to contribute a few tools
some day, but for now, I expect the apps the I write to pay the bills
will continue to be written in VB6 or .NET (or ASP/VBScript).

- I know that a big potential plus for Python, and even the GUI
platforms like wxPython is it's cross-platform capability.  The success
of stuff like Lindows and the cheap Wal-Mart computers may change
things, but for now, practically all the folks that I run in to looking
to have apps developed, run Windows - so, at least for now, I'm not
really 'gaining market share' by being portable to other platforms.
Also, after developing Web apps for the last few years, and having to
deal with browser differences, I've found that when it comes to user
interfaces, 'cross-platform' has to be take with a grain of salt.  I'm
in awe of what folks like Robin Dunn are able to do in getting things to
work across different platforms, but the wxPython-users list is a
testimony to the difficulty in truly achieving this.

Good luck on your search,

--
Greg


"Etienne Charland" <mystery at golden.net> wrote in message
news:PxQR9.45$uS3.4626462 at mantis.golden.net...
> I would like to compare Python with .Net. First of all, for those who
knows
> .Net, what are the pros and the cons of each? Secondly, how would I
write
> this simple database application in Python, to see how it looks like.
I've
> written the code required to do it in VB.Net.






More information about the Python-list mailing list