Re: BASIC vs Python

Discussion in 'Python' started by Adam DePrince, Dec 17, 2004.

  1. 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
    Adam DePrince, Dec 17, 2004
    #1
    1. Advertising

  2. Adam DePrince

    It's me Guest

    "Adam DePrince" <> 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
    >
    >
    It's me, Dec 17, 2004
    #2
    1. Advertising

  3. Adam DePrince

    Andrew Dalke Guest

    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
    Andrew Dalke, Dec 17, 2004
    #3
  4. 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
    Gregor Horvath, Dec 17, 2004
    #4
  5. Adam DePrince

    Mike Meyer Guest

    Andrew Dalke <> 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 <> http://www.mired.org/home/mwm/
    Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
    Mike Meyer, Dec 17, 2004
    #5
  6. On Fri, 17 Dec 2004 01:43:56 -0600, rumours say that Mike Meyer
    <> 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 RFC1958)
    I really should keep that in mind when talking with people, actually...
    Christos TZOTZIOY Georgiou, Dec 17, 2004
    #6
  7. 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.
    Peter Hickman, Dec 17, 2004
    #7
  8. Adam DePrince

    Peter Otten Guest

    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
    Peter Otten, Dec 17, 2004
    #8
  9. 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+7w7wV98WyVNy8gCeP+7K
    SWvDKxjYq/h30euZtQ0anQE=
    =H9DT
    -----END PGP SIGNATURE-----
    Gerhard Haering, Dec 17, 2004
    #9
  10. 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
    Gregor Horvath, Dec 17, 2004
    #10
  11. 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.
    Peter Hickman, Dec 17, 2004
    #11
  12. Adam DePrince

    Peter Otten Guest

    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
    Peter Otten, Dec 17, 2004
    #12
  13. "Christos TZOTZIOY Georgiou" <> wrote in message
    news:...
    > On Fri, 17 Dec 2004 01:43:56 -0600, rumours say that Mike Meyer
    > <> 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 :)
    Richards Noah \(IFR LIT MET\), Dec 17, 2004
    #13
  14. Adam DePrince

    It's me Guest

    "Gregor Horvath" <> wrote in message
    news:%%zwd.12738$...
    > 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".
    It's me, Dec 17, 2004
    #14
  15. Adam DePrince

    Peter Otten Guest

    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
    Peter Otten, Dec 17, 2004
    #15
  16. 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
    Gregor Horvath, Dec 17, 2004
    #16
  17. Adam DePrince

    Steve Holden Guest

    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
    Steve Holden, Dec 17, 2004
    #17
  18. Adam DePrince

    Steve Holden Guest

    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
    Steve Holden, Dec 17, 2004
    #18
  19. Adam DePrince

    Hans Nowak Guest

    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/
    Hans Nowak, Dec 17, 2004
    #19
  20. 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>
    Fredrik Lundh, Dec 17, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Orange Free

    Python vs Visual Basic

    Orange Free, Oct 13, 2003, in forum: Python
    Replies:
    8
    Views:
    1,119
    Alex Martelli
    Oct 13, 2003
  2. Robert Brewer

    RE: Python vs Visual Basic

    Robert Brewer, Oct 13, 2003, in forum: Python
    Replies:
    7
    Views:
    455
    Orange Free
    Oct 19, 2003
  3. Davide

    Python + Visual Basic

    Davide, Feb 20, 2004, in forum: Python
    Replies:
    2
    Views:
    285
    Michel Claveau/Hamster
    Feb 20, 2004
  4. Engineer
    Replies:
    6
    Views:
    604
    Jeremy Bowers
    May 1, 2005
  5. Replies:
    0
    Views:
    417
Loading...

Share This Page