Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: BASIC vs Python

Reply
Thread Tools

Re: BASIC vs Python

 
 
Peter Hickman
Guest
Posts: n/a
 
      12-17-2004
Gerhard Haering wrote:
> IIRC BASIC does have a portable language definition:
> ANSI BASIC, which is the old crap with GOTO and GOSUB that nobody in
> their right mind would want to use nowadays ...


True, I forgot about that. The nearest to portable I have seen is Bywater Basic.
At least it is written in C and can be ported to most machines. However it is
still old school - though less so than ANSI BASIC.
 
Reply With Quote
 
 
 
 
Peter Otten
Guest
Posts: n/a
 
      12-17-2004
Gerhard Haering wrote:

> In VB6, it would an exercise of working around the limitations of the
> data structures.


In MS Access I would probably end up with two database tables. The
juxtaposition of incredibly polished and virtually unusable features is
amazing.

Peter

 
Reply With Quote
 
 
 
 
Richards Noah \(IFR LIT MET\)
Guest
Posts: n/a
 
      12-17-2004

"Christos TZOTZIOY Georgiou" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Fri, 17 Dec 2004 01:43:56 -0600, rumours say that Mike Meyer
> <(E-Mail Removed)> might have written:
>
> >Assembler was better - at least you had recursion with
> >assembler.

>
> You had recursion with BASIC --what you probably mean is that you had no
> stacked parameters (unless you imitated that with using an indexed
> array).
>
> 90 rem recursion
> 100 print "beautiful colours"
> 110 gosub 100


I think he means that you had no recursive function calls in BASIC. I
suppose, to most of us, "recursion" doesn't mean "doing things more than
once," since by that definition, iteration is also recursion. Recursion
generally means some type of self reference, like in functional languages,
where the simplest recursion is base case/recurring step. BASIC didn't do
this, without a bit of unsightly hackery. Then again, I don't believe that
it was really a concern at the time, so I don't suppose its too important of
an issue


 
Reply With Quote
 
It's me
Guest
Posts: n/a
 
      12-17-2004

"Gregor Horvath" <(E-Mail Removed)> wrote in message
news:%%zwd.12738$(E-Mail Removed)...
> Peter Otten wrote:
>
> > May you could give us an idea of the current state of basic affairs then

by
> > translating the following example snippet:

>
> yes you can do it in VB6, but pythons lists and dictionarys are superior
> to those built in in VB and I think to those in most other languages.
>
> >
> > It's me wrote:
> >
> >
> >>I saw this code from an earlier post:
> >>
> >>lst1 = ["ab", "ac", "ba", "bb", "bc"]
> >>lst2 = ["ac", "ab", "bd", "cb", "bb"]
> >>dct1 = dict.fromkeys(lst1)
> >>print [x for x in lst1 if x not in dct1]
> >>print [x for x in lst1 if x in dct1]

>
> I think line3 should be
>
> >>dct1 = dict.fromkeys(lst2)

>
> correct?
>


Correct.

> VB6 Code:
>
> Sub xy()
>
> Dim lst1 As New Collection
> Dim lst2 As New Collection
>
> lst1.Add "ab", "ab": lst1.Add "ac", "ac": lst1.Add "ba", "ba": lst1.Add
> "bb", "bb": lst1.Add "bc", "bc"
> lst2.Add "ac", "ac": lst2.Add "ab", "ab": lst2.Add "bd", "bd": lst2.Add
> "cb", "cb": lst2.Add "bb", "bb"
>
> For Each item In lst1
> If ColHasKey(lst2, item) Then Debug.Print "in:" & item
> Next
>
> For Each item In lst1
> If Not ColHasKey(lst2, item) Then Debug.Print "not in:" & item
> Next
>
> End Sub
>
>
> Function ColHasKey(col As Collection, item) As Boolean
> On Error GoTo er
> A = col(item)
> ColHasKey = True
> Exit Function
> er:
> If Err.Number = 5 Then
> ColHasKey = False
> Else
> Err.Raise Err.Number
> End If
> End Function


Absolutely *ugly*!

But still, your point is well taken. Thank you for pointing this out.

Adam was right:

"Don't do it, unless your goal is simply to embarrass and insult
programmers".




 
Reply With Quote
 
Peter Otten
Guest
Posts: n/a
 
      12-17-2004
Gregor Horvath wrote:

> Peter Otten wrote:
>
>> May you could give us an idea of the current state of basic affairs then
>> by translating the following example snippet:

>
> yes you can do it in VB6, but pythons lists and dictionarys are superior
> to those built in in VB and I think to those in most other languages.
>
>>
>> It's me wrote:
>>
>>
>>>I saw this code from an earlier post:
>>>
>>>lst1 = ["ab", "ac", "ba", "bb", "bc"]
>>>lst2 = ["ac", "ab", "bd", "cb", "bb"]
>>>dct1 = dict.fromkeys(lst1)
>>>print [x for x in lst1 if x not in dct1]
>>>print [x for x in lst1 if x in dct1]

>
> I think line3 should be
>
> >>dct1 = dict.fromkeys(lst2)

>
> correct?


Either that or lst2 in the list comprehensions.

> VB6 Code:


[snip]

> Function ColHasKey(col As Collection, item) As Boolean
> On Error GoTo er
> A = col(item)
> ColHasKey = True
> Exit Function
> er:
> If Err.Number = 5 Then
> ColHasKey = False
> Else
> Err.Raise Err.Number
> End If
> End Function


Almost an exception handler
Thank you for taking the time to show me. I had VB.Net in mind when I wrote
"current state", though.

Peter

 
Reply With Quote
 
Gregor Horvath
Guest
Posts: n/a
 
      12-17-2004
It's me wrote:
> Absolutely *ugly*!
>
> But still, your point is well taken. Thank you for pointing this out.
>
> Adam was right:
>
> "Don't do it, unless your goal is simply to embarrass and insult
> programmers".



OK. Then please schow me, how you can create a complex form with grids,
explorer like trees etc. in 2 minutes in standard python.

Or make any given standard python object accessible from MS Excel in 2
minutes.

--
Greg
 
Reply With Quote
 
Steve Holden
Guest
Posts: n/a
 
      12-17-2004
Adam DePrince wrote:

> On Thu, 2004-12-16 at 13:36, abisofile wrote:
>
>>hi
>>
>>I'm new to programming.I've try a little BASIC so I want ask since
>>Python is also interpreted lang if it's similar to BASIC.

>
>
> Nobody is answering this question because they are shuddering in fear
> and revulsion.
>
> During the 1980's BASIC was the language to embedd into the ROM's of the
> computers of the day. This was in a misguided effort to make computers
> understandable to their target audience. The goal of the day was to
> build a system that a manager would want to buy; it was believed that
> the only way for a manager to see the value of a system was to make the
> language understandable to said manager. The expectation, of course,
> that the manager would sit down and play with the computer instead of
> delegating the tasks to somebody more qualified is somewhat misguided in
> hindsight. To do that, a language that closely resembled the process of
> micromanaging an untrained worker was employed.
>

But that language was COBOL, not BASIC. BASIC is actually an acronym for
"Beginners' All-purpose Symbolic Instruction Code", which the initial
implementations at Dartmouth weren't, really. The big innovation was the
use of line-numbering to allow interactive editing and testing of a program.

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
 
Reply With Quote
 
Steve Holden
Guest
Posts: n/a
 
      12-17-2004
Gregor Horvath wrote:

> It's me wrote:
>
>> Absolutely *ugly*!
>>
>> But still, your point is well taken. Thank you for pointing this out.
>>
>> Adam was right:
>>
>> "Don't do it, unless your goal is simply to embarrass and insult
>> programmers".

>
>
>
> OK. Then please schow me, how you can create a complex form with grids,
> explorer like trees etc. in 2 minutes in standard python.
>
> Or make any given standard python object accessible from MS Excel in 2
> minutes.
>

If only one could. That would be a system worth using.

For what it's worth, the estimable "Win32 Programming in Python" by
Hammond anf Robinson does spend quite a lot of space explaiing how to
build Python functionality with VB-style front-ends.

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
 
Reply With Quote
 
Hans Nowak
Guest
Posts: n/a
 
      12-17-2004
Gregor Horvath wrote:

> It's me wrote:
>
>> Absolutely *ugly*!
>>
>> But still, your point is well taken. Thank you for pointing this out.
>>
>> Adam was right:
>>
>> "Don't do it, unless your goal is simply to embarrass and insult
>> programmers".

>
> OK. Then please schow me, how you can create a complex form with grids,
> explorer like trees etc. in 2 minutes in standard python.


To be fair, this is more a property of a GUI builder than of a language...

--
Hans Nowak
http://zephyrfalcon.org/

 
Reply With Quote
 
Fredrik Lundh
Guest
Posts: n/a
 
      12-17-2004
Richards Noah wrote:

>> You had recursion with BASIC --what you probably mean is that you had no
>> stacked parameters (unless you imitated that with using an indexed
>> array).
>>
>> 90 rem recursion
>> 100 print "beautiful colours"
>> 110 gosub 100

>
> I think he means that you had no recursive function calls in BASIC. I
> suppose, to most of us, "recursion" doesn't mean "doing things more than
> once," since by that definition, iteration is also recursion. Recursion
> generally means some type of self reference


Note that he uses gosub, not goto. The code block that starts at line 100
and ends at line 110 calls itself recursively. Works just fine in many (most?)
BASIC implementations (at least until you run out of call stack).

(the original BASIC was a different thing, though: quoting from the 1964 hand-
book: "the user must be very careful not to write a program in which GOSUB
appars inside a subroutine which itself is entered via a GOSUB; it just won't
work". The handbook also states that the program size is limited to "two feet
of teletype paper"...)

</F>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TurboTax Basic vs. Taxcut Basic? Sharp Dressed Man Computer Support 1 01-12-2009 12:52 PM
What is the difference between Visual Basic.NET and Visual Basic 6? Jimmy Dean Computer Support 3 07-25-2005 07:05 AM
Re: Python interpreter in Basic or a Python-2-Basic translator. rrr@ronadam.com Python 0 05-02-2005 01:48 PM
Python interpreter in Basic or a Python-2-Basic translator. Engineer Python 6 05-01-2005 10:16 PM
Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET Jaime MCSD 2 09-20-2003 05:16 AM



Advertisments