[Tutor] Translate this VB.NET code into Python for me?

Alan Gauld alan.gauld at btinternet.com
Tue Mar 4 19:05:08 CET 2008

"Dick Moores" <rdm at rcblue.com> wrote in message 
news:20080304130635.D16391E400E at bag.python.org...
>I thought I'd dip into .NET by downloading the free Microsoft Visual
> Basic 2005 Express Edition, and start working through _Beginning
> Visual Basic 2005 Express Edition_, by Peter Wright (Apress).
> By the second chapter I've begun to suspect that GUIs aside, Python
> is a lot simpler to write.

It depends, there are other areas where VB is at least comparable
to Python, especially in manipulating the Windows OS and using
COM features etc.

> Could someone prove that to me by translating the code I've pasted

Jerry has done a fine job of that but it doesn't really prove much 
as he says VB has a few features that Python doesn't directly
support (and vice versa). But also console level apps are exactly
where Python is strong and VB weak so this kind of example
proves that Python is better for simple OOP code using a CLI.

You could do a GUI example and use IronPython to show how
it copes with GUI code. Since IP can access the same GUI
library as VB.NET they should be very similar in code structure.

I would expect VB.NET to always be at least a bit more
verbose than Python because of its heritage, but in basic
concepts, as your example shows, it can do pretty much the
same kinds of things as Python (but with a much smaller
standard library!).


Alan Gauld
Author of the Learn to Program web site
Temorarily at:

More information about the Tutor mailing list