Considering migrating to Python from Visual Basic 6 for engineering applications

BartC bc at freeuk.com
Sun Feb 21 11:16:28 EST 2016


On 21/02/2016 15:08, Jussi Piitulainen wrote:
> BartC writes:

>> In other words, it seems this particular wheel does require
>> re-inventing!
>
> It's hardly Python's problem if an engineer is worried about some VB not
> being there in its current form in the future. The sample code upthread
> seemed gibberish to me

I don't know VB6 but:

  Open "N020S.TXT" For Input As #8

  Input #8, ND, NIN, NT ' all integers

seems clear enough: read 3 integers from the text file just opened on 
channel 8, and store them in variables ND, NIN and NT.

But this is not so much to do with VB6, but with a very fundamental 
capability that seems missing in modern languages.

IIRC, the first programming exercise I ever did (in 1976 using Algol 60) 
involved reading 3 numbers from the teletype and working out if those 
could form sides of a triangle. It might have started off like this (I 
can't remember Algol 60):

   print "Type 3 numbers:"
   read a, b, c

In Basic, that last line might be:

   input a, b, c

instead (reading here as floats probably).

Now, nearly 40 years later, I don't actually know how to do that in 
Python! Sure, I can cobble something together, with all sorts of 
functions and string operations (and I would need to go and look them 
up). But it's not just /there/ already.

If you gave this a Python exercise to a class of students, you'd end up 
with 30 different solutions just for the first, easy part of the 
exercise! In fact it would be far more challenging than the triangle 
problem. That can't be right.

-- 
Bartc





More information about the Python-list mailing list