Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!lll-lcc!qantel!hplabs!oliveb!glacier!cascade!asente From: asente@cascade.ARPA (Paul Asente) Newsgroups: net.lang Subject: Re: structured assembler (BASIC) Message-ID: <77@cascade.ARPA> Date: Thu, 27-Mar-86 18:50:53 EST Article-I.D.: cascade.77 Posted: Thu Mar 27 18:50:53 1986 Date-Received: Sun, 20-Apr-86 15:20:51 EST References: <443@3comvax.UUCP> <7900003@ztivax.UUCP> <153@crin.UUCP> <7947@watrose.UUCP> Reply-To: asente@cascade.UUCP (Paul Asente) Organization: Stanford University CIS Apple Orchard Lines: 54 Keywords: BASIC In article <7947@watrose.UUCP> tohaapanen@watrose.UUCP (Tom Haapanen) writes: >Input and output from subroutines? But BASIC does not allow formal >parameters or returned results! Having to pass input in global >variables is gross and practically prevents recursion. ... >if...then...else should NOT need a goto and it shouldn't have one forr >clarity. Naturally, if the language is brain-damaged enough to be >missing the else, you'd need a goto. ... > > >In my opinion any reasonable programming language has the following >features: > - reasonable (!) syntax and variable name length > - named subroutines, with parameters and results > - dynamic local storage allocation (to allow for recursion) > - control structures: if...then...else, while...end, > for...end, case > - data structures: arrays and records, with dynamic > allocation possible (to allow variable-sized structures) > >A case can be made for languages that are missing one of the five >(such as APL2 etc.) but "normal" BASIC only has the first feature! >There are BASICs that have four of the five, but then they are more >like Pascal than BASIC anyway. > > Ragging on BASIC seems to be everyone's favorite activity. Unfortunately they seem to be fixated upon BASIC-1966, not BASIC-1986. Yes, early BASICs were pretty primative, but remember the environment--very fast turnaround small programs for beginning programmers. It's very easy to look back upon the various decisions that were made in the design and laugh from a vantage point of twenty years later, but is that fair? It isn't, especially since BASIC has been an evolving language from the start. Early compiler technology couldn't handle complicated stuff and still be fast. As technology improved, so did BASIC. (Side note: Contrary to popular belief, BASIC was not designed as an interpreted language.) Modern BASIC has separately compilable subroutines (actually, they've been in the language since at least the early 70's), variable length identifiers, recursion, "modern" control structures, exceptions, and graphics. It still has many of the good features from early BASICs, some of which are much better than what you find in Pascal: easy-to-use I/O, dynamic strings, simple data types (is the distinction between integer and real that important for beginning programmers? I think not.). I'm not claiming that BASIC is the ideal language, or that it's the best language to use for large projects. But as a teaching language and a language for writing quick throwaway programs it is a very reasonable choice. -paul asente asente@cascade.ARPA decwrl!glacier!cascade!asente