Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

Re: BASIC vs Python

 
 
Adam DePrince
Guest
Posts: n/a
 
      12-17-2004
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.

In BASIC you literally list the steps the computer will follow. Each
step gets a line number. Decisions are controlled by jumping to
different "line numbers." No where in the language was there any notion
of or ability to make your program remotely abstract. You know those
jokes on slashdot.org that read:

1. Do something
2. Do something else
3. Wash
4. Repeat (goto step #1)

That is BASIC in a nut shell. Sure, modern versions have gotten a
little better, dispensing of evils such as line numbers and the like,
but they are only marginally better.

Each language carries with it a philosophy. BASIC stands alone in being
so utterly perverse that learning it will render you completely
unmarketable, except as a basic programmer, as you unlearn its
limitations and learn how to think in the abstractions of every other
language.

If you want to learn how to program, Python is a good start. IIRC,
Python started its life as ABC, a language designed specifically as an
educational language. In this sense alone it is similar to BASIC, but
this is where any similarity ends.

Perhaps I can best illustrate the difference between the two with an
analogy. Suppose you came to me and asked which was a better way of
learning a foreign language, the python way or the BASIC way.

The Python way would be how a language is taught in any normal class you
might find at a local college. You learn the vocabulary, grammar,
history and culture of the language.

Now let us provide a contrast. Imagine you are in a class and the
teacher only teaches you curse words. You learn no grammar, no history,
no culture. At best, you have only the slightest idea of what kind of
curse word each is (scatological, sexual, religious, etc.) But you are
forced to memorize the same list of curse words over and over again in
order. This is the BASIC way of learning to program.

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



Adam DePrince


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

"Adam DePrince" <(E-Mail Removed)> wrote in message

<snip>

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


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]

It's simply remarkable for somebody to be able to do it so cleanly (and so
obviously) - "out of the box", if you may.

Sure, you can do it in Basic. Ur...sure? Yes, sure...


>
>
> Adam DePrince
>
>



 
Reply With Quote
 
 
 
 
Andrew Dalke
Guest
Posts: n/a
 
      12-17-2004
Adam DePrince
> 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.


That doesn't sound like the 1980s I remember but I was biased
because I those included my teenage years and I wasn't a manager.

I though part of the market was for parents of kids like me.
In my case I learned from the book that came along with the
computer. I remember how confusing arrays were ("By default
it only takes numbers between 1 and 10, so I should be able
to use 2.5, right?"). I don't think I could have handled
UCSD Pascal on my own nor the other languages available at
the time.

Editing BASIC is also dead simple to read and to implement
on a machine with a few K of RAM. Compare to EDLIN for
DOS or other editors of the era. That's the era of WordStar
and the ^K^B and ^K^K control character commands. Again,
not something a beginning solo student programmer can
likely pick up easily.

The BASICs of my youth also supported graphics and sounds.

PLAY "CGFED>C<GFED>C<GFEFB"

HGR
HPLOT 0,0 to 20,40

Twenty, yes *20* years later there's still no standard
module for Python for doing the sound effects I could do
on my old TI 99/4A, even without the hardware speech
synthesizer (fun for Parsec and a few other games

> In BASIC you literally list the steps the computer will follow. Each
> step gets a line number. Decisions are controlled by jumping to
> different "line numbers." No where in the language was there any notion
> of or ability to make your program remotely abstract. You know those
> jokes on slashdot.org that read:


True, for the basics on those microcomputers. In 1987
or so (maybe 1986) I switched over to Quickbasic which
got rid of those problems, included an IDE, and produced
fast compiled code. TrueBasic was also available in 1987.


> That is BASIC in a nut shell. Sure, modern versions have gotten a
> little better, dispensing of evils such as line numbers and the like,
> but they are only marginally better.


Modern = last 15+ years. My experience with with the now
very dated Quickbasic which I last touched in .. 1993? It
seemed quite comparable to Turbo Pascal in its capabilities.

> Each language carries with it a philosophy. BASIC stands alone in being
> so utterly perverse that learning it will render you completely
> unmarketable, except as a basic programmer, as you unlearn its
> limitations and learn how to think in the abstractions of every other
> language.


Which was just fine with me. I learned Pascal in Sr. High,
C in college (and C++ and Fortran) and didn't get paid to be
a full-time programmer until 3 years after I graduated college.


> Perhaps I can best illustrate the difference between the two with an
> analogy. Suppose you came to me and asked which was a better way of
> learning a foreign language, the python way or the BASIC way.


> The Python way would be how a language is taught in any normal class
> you might find at a local college. You learn the vocabulary, grammar,
> history and culture of the language.


Let's try this recasting of your analogy.

Suppose you had to learn Latin without a teacher or without
access to Latin speakers. The only way you had to get feedback
was by typing a letter to the Latin Language Institute, fortunately
staffed by very patient folks but they only reply in Latin.
All you have is a book that came along with the typewriter.

You don't at this point know there is a culture or a history.
Rome? What's that? But you like horses so you start writing
about equus. The LLI responds with a bit more about horses.
A conversation starts. After a lot of practice you learn
you can do more with Latin than talk about horses and find
there's over 2,500 years of recorded history in Latin, including
stories about horses.

Finally you move to a place that has a language teacher and
you learn Latin more rigously, that it's "Romani ite domum"
and not "Romanes eunt domus", and find out about Greek, and
Swedish, and Japanese, and all sorts of other interesting
languages.

Given the hardware constraints of the early 1980s, which
language do you think should have been used instead of BASIC?

Andrew
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
Gregor Horvath
Guest
Posts: n/a
 
      12-17-2004
Hi,

Adam DePrince wrote:

> 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


[..]

BASIC = Beginners all purpose symbolic instruction code

ABC = laerning language

Python = Follows IMHO the same goals as BASIC did,
make programming as simple as possible, they are related

Sure for people loving technology and complexity this goals (simplicity,
easy to understand) are the opposite of their interests. Therefore both
BASIC and Python do have the same opposition with very similar arguments.

Complexity is the evil of all programming. Reducing it is a win.
Therefore BASIC was right and python is also because they follow the
same philosophy.

For example: I even think that the meaningful identation in python is
the continuation of the absence of a line delimiter in BASIC. Braces and
semicolons are essentially useless and redundant because indentation and
LF are already there, therefore leave it out; well this is indeed the
meaning of the word basic.

--
Greg
 
Reply With Quote
 
Mike Meyer
Guest
Posts: n/a
 
      12-17-2004
Andrew Dalke <(E-Mail Removed)> writes:

> Adam DePrince
> Given the hardware constraints of the early 1980s, which
> language do you think should have been used instead of BASIC?


Logo. It was invented in 1968, when mainframes weren't much more
powerfull than those '80s microcomputers. It had standard graphics
primitives that are *much* saner than hacking at a bitmapped
display. It was designed specifically to teach children how to think
logically.

You can find out more - including a list of current implementations
and example code - at <URL:
http://en.wikipedia.org/wiki/Logo_programming_language >.

BASIC as implented by Microsoft for the Apple II and the TRS 80 (among
others) is simply the worst programming language I have ever
encountered. Assembler was better - at least you had recursion with
assembler.

<mike
--
Mike Meyer <(E-Mail Removed)> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
 
Reply With Quote
 
Christos TZOTZIOY Georgiou
Guest
Posts: n/a
 
      12-17-2004
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
--
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC195
I really should keep that in mind when talking with people, actually...
 
Reply With Quote
 
Peter Hickman
Guest
Posts: n/a
 
      12-17-2004
Mike Meyer wrote:
> BASIC as implented by Microsoft for the Apple II and the TRS 80 (among
> others) is simply the worst programming language I have ever
> encountered. Assembler was better - at least you had recursion with
> assembler.


Basic has progressed much since you last looked at it, time to update your
facts. Basic has recursion, it compiles to native code, it has objects, can be
event driven and everything else you would expect of a language.

Computing changes too fast to allow you to think you know it all. Keep up to
date granddad.

However what basic doesn't have is a portable language definition.
 
Reply With Quote
 
Peter Otten
Guest
Posts: n/a
 
      12-17-2004
Peter Hickman wrote:

> Mike Meyer wrote:
>> BASIC as implented by Microsoft for the Apple II and the TRS 80 (among
>> others) is simply the worst programming language I have ever
>> encountered. Assembler was better - at least you had recursion with
>> assembler.

>
> Basic has progressed much since you last looked at it, time to update your
> facts. Basic has recursion, it compiles to native code, it has objects,
> can be event driven and everything else you would expect of a language.
>
> Computing changes too fast to allow you to think you know it all. Keep up
> to date granddad.
>
> However what basic doesn't have is a portable language definition.


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

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]
>
> It's simply remarkable for somebody to be able to do it so cleanly (and so
> obviously) - "out of the box", if you may.
>
> Sure, you can do it in Basic.**Ur...sure?**Yes,*sure...


Peter

 
Reply With Quote
 
Gerhard Haering
Guest
Posts: n/a
 
      12-17-2004
On Fri, Dec 17, 2004 at 11:49:22AM +0100, Peter Otten wrote:
> Peter Hickman wrote:
> > [..] Basic has progressed much since you last looked at it, time
> > to update your facts. Basic has recursion, it compiles to native
> > code, it has objects, can be event driven and everything else you
> > would expect of a language.
> >
> > Computing changes too fast to allow you to think you know it all. Keep up
> > to date granddad.
> >
> > However what basic doesn't have is a portable language definition.

>
> May you could give us an idea of the current state of basic affairs then by
> translating the following example snippet: [...]


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 ...

I only know about Visual Basic 5.0/6.0 and a little about Visual Basic
.NET and thanks to the .NET standard library it's possible to write
the Python code you gave us in relatively clean VB.NET with the
collections classes.

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

-- Gerhard
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBwsUTdIO4ozGCH14RAnkjAJwMqA74sEuQ9bH+7w7wV9 8WyVNy8gCeP+7K
SWvDKxjYq/h30euZtQ0anQE=
=H9DT
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Gregor Horvath
Guest
Posts: n/a
 
      12-17-2004
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?

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
 
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