Home >> Computers >> Programming >> Languages >> BASIC


  Comparison and Review
  Graphics
   

  Java-Based Implementations
  Macintosh-specific
   

  BBC BASIC
BlitzBasic
Business BASIC
DarkBasic
GW-BASIC
Just BASIC
Liberty BASIC
  MediaBASIC
Palm OS specific
Pick BASIC
PowerBASIC
QBasic and QuickBasic
Rapid-Q
REALBasic
  SmallBASIC
True BASIC
Visual Basic
XBasic
Yabasic


BASIC occurs as personal of high-level programming languages. Originally devised as an easily-to-have programing language, it became far flung in home microcomputers in the 1980s, and remains popular to this day around the handful of heavy evolved idiom. It was devised around 1963 by Profs. John G. Kemeny and Thomas E. Kurtz of Dartmouth College.

BASIC's title, coined within classic, computer science tradition to produce the nice acronym, stands for ''Beginner's Thell-purpose Symbolic I personallynstruction Hundredode'', attached to the title of an unpublished paper per language's co-inventor, Thomas Kurtz (a title so with there are no relation to C.K. Ogden's series "Basic English"). Many versions of the popular Jargon File once claimed that BASIC is a backronym created in the 1970s (recent versions have corrected this). Grounds to believe from either a original Dartmouth BASIC manual (1964) show this to become untrue, however many low lexicon & book of facts using your internet browser use at times today proliferated a earliest Jargon File's error.

BASIC through the years

Background
Before a mid-1960s, computers were highly expensive information utilized just for favorite-purpose tasks, which ran one "job" at once (batch processing). In a period of the Sixties, nonetheless, computer numbers began to drop to in which potentially little corporations can afford the two, & their speed increased pertinent in which it typically sat idle, forgoing jobs to dog.

Programing language of a era tended to exist as designed, rather the machines in which it ran, for specific purposes like scientific formula processing. Since lone-job machines were expensive, a tendency was to assume execution speed a first feature of completely. In the main, it were protective to apply, & tended toward the certain "ugliness."

It was at this period that a time-sharing system concept began to get popular. Around such a patterns the processing instance of the independent computer is "sliced up" & to each one user is given the little total within alternation. A machines were convenient plenty for virtually everthing users to sense it got one machine all to themselves. Within theory, timesharing decreased a numbers of computing enormously, as a lone machine can be shared among hundreds of users.

Birth and early years

A original BASIC language was invented inside 1963 by John Kemeny (1926–1993) and Thomas Kurtz (1928–) at Dartmouth College and implemented by a team of Dartmouth students under their counsel. In the when punishment years, as more idiom of BASIC appeared, Kemeny & Kurtz' original BASIC accent became called Dartmouth BASIC.

BASIC was designed to allow students to write computer program applying period-sharing computer terminals. BASIC was designed to location a complexness issues of older languages using a fresh language designed specifically for the freshly class of users the period-sharing systems allowed — that is, the "simpler" user world health organization wwhen non when concerned around speed as within only existence entity to have a machine.

A eight project information of BASIC were:

  • Exist as real life for beginners to use
  • Exist as the general-purpose programming language
  • Allow advanced features to become added for experts (when keeping a language elementary for beginners)
  • Become interactive
  • Provide clear & friendly error messages
  • Respond convenient for little programs
  • Non take an understanding of computer hardware
  • Shield a user from either a operating system

    A language was depending partially in FORTRAN II and partly in ALGOL 60, with additions to produce it suitable for timesharing &, down the road, text processing & matrix arithmetic. BASIC was number 1 implemented on the GE-265 mainframe which supported multiple terminals. Contrary to popular belief, it was the compiled language at the instance of its introduction. Many years when its release, extremely-respected computer agents, notably Edsger W. Dijkstra, expressed their opinions that the use of GOTO statements, which existed in many languages including BASIC, promoted poor programming practices.* Some also derided BASIC as too slow and too simple.

    Yet, a designers of the language decided that it should remain in the public domain sequentially to help it spread. It as well processed it available to high inside a Dartmouth front yard & spent the considerable total of effort in promoting the language. Following, cognitiin of BASIC became comparatively far flung for the machine-oriented language & BASIC was implemented by the total of manufacturers, & became fairly popular on freshly minicomputers like a DEC PDP series and a Data General Nova. Around these cases the language tended to become implemented as an interpreter instead of a compiler, or even alternately, each were supplied.

    * Within the 1968 article, Dutch computer scientist Edsger Dijkstra considered programming languages utilizing GOTO statements for program structuring purposes harmful for a productivity of the programmer too when the quality of the consequent code ([http://www.acm.org/classics/oct95/ "Go To Statement Considered Harmful"], Communications of the ACM Volume Xi, 147-148. 1968). This article doesn't mention any particular programing language; it only states that a overexploitation of GOTO occurs as bad tool & gives a technical indicator reasons how come this should become then.

    Witharound the 1975 tongue-in-facetious article, [http://www.cs.virginia.edu/~evans/cs655/readings/ewd498.html "How do We Tell Truths that Might Hurt"], Sigplan Notices Volume Seventeen There are no. Quintuplet, Dijkstrthe gives a listing of pinching "truths", including his opinion of many programing language of the instance, like BASIC. It appears that numerous population confuse them articles & conclude that he particularly despised BASIC following of its GOTO statement. Notwithstanding, BASIC receives there are no worse professional assistance than PL/I, COBOL or APL in his articles.

    Explosive growth

    However a language's have in many minicomputers, it was a introduction of the Altair 8800 microcomputer in 1975 that truly spread BASIC. Virtually all programing language were overlarge to accord the little memory virtually all users can afford in these machines, & by having a slow storage in paper tape (or even late audio cassette tape: disks of any form were non available at any price for a bit of years) & the deficiency of suitable text editors, a little language prefer BASIC was a good healthy. BASIC besides experienced a benefit that it was fairly easily known to a immature designers world health organization took an interest around personal computer at the period following of Kemeny & Kurtz's sooner proselytizing. One of a number 1 to pop up for this machine was Tiny BASIC, a elementary BASIC implementation originally written by Dr. Li-Chen Wang, and then ported onto a Altair by Dennis Allison at a asking of Bob Albrecht (who down the road founded Dr. Dobb's Journal). A Microscopic single-celled BASIC project & a fully source code were published withwithin 1976 in DDJ.

    Within 1975, Microsoft (then merely ii population—Bill Gates and Paul Allen) released Altair BASIC. A version written for the Altair was co-authored by Gates, Allen & Monte Davidoff. Versions so began appearing inside more platforms under license, & hundreds to thousands of copies & variants were shortly in utilise; it became one of a standard languages on the Apple II. By 1979, Microsoft was talking with many pc trafficker, including IBM, about licensing the BASIC interpreter for their computers. The version was involved in the IBM PC ROM chips and PCs while forgoing floppy disks automatically booted into BASIC.

    Fresh corporations attempted to watch a successes of MITS, IMSAI, North Star and Apple, thus creating a home computer revolution; meanwhile, BASIC became the standard feature of tons however a super couple at home computers. Virtually all come sustaining the BASIC interpreter around ROM. Shortly there were numerous hundreds to thousands of machines running off BASIC around the world, in a lot likelihood the far greater total than all the users of all more languages conjointly.

    Maturity

    Numbers of recently BASIC versions were created in the time period of this period. Microsoft sold many versions of BASIC for MS-DOS/PC-DOS including BASICA, GW-BASIC (a BASICA-compatible version that did non want IBM's ROM) & Quick BASIC. Turbo Pascal-publisher Borland published Turbo BASIC 1.0 inside 1985 (successor versions come however existence sold by a second company under a title PowerBASIC). Various extensions of front yard computer BASIC appeared, generally by using graphics, healthy & DOS commands, also when facilities for structured programming. A BBC published BBC BASIC, developed for them by Acorn Computers Ltd, incorporating many more structuring keywords, also when comprehensive & versatile straight access to the operating body. It likewise featured the fully integrated assembly program. More languages utilized a widely-known BASIC syntax when a basis for otherwise wholly different systems, GRASS being one case.

    Nonetheless, per latter half of the 1980s newer computers were far more complex & involved features (like graphical user interfaces—GUIs) that made BASIC less suitable for programming. At the equivalent period, computers experienced progressed from either a hobbyist interest to information utilized primarily for applications written by others, & programming as a whole became less significant for the growing majority of users. BASIC began to fade, though many versions remained available.

    BASIC's fortune reversed over again sustaining a introduction of Visual Basic from Microsoft. Though these are somewhat hard to assume this language to get BASIC (despite its numbers of familiar BASIC keywords) per instance of writing it got become one of a virtually all-utilized languages on the Windows platform. These are said to represent a select few Seventy to 80% of 100% commercial development. Microsoft created the variant known as WordBasic & utilized it around versions of MS Word prior to Word 97. Microsoft added Visual Basic for Applications (VBA) to Excel 5.0 in 1993, to Access 95 in 1995, and to the rest of its Office suite in 1997. Internet Explorer Three.Nought & late & Microsoft Outlook involved the VBScript interpreter. A virtually all recent version of Visual Basic is known as VB.NET. A competing OpenOffice suite also includes the BASIC variant.

    Numerous more BASIC variants & adaptations develop likewise grow in the go couple of years, authored by hobbyists, devices developers, & others. A single variant, developed within 1996 away from market require, is the PIC BASIC compiler. The relative of the BASIC Stamp's PBASIC, PIC BASIC allows hobbyists to program microcontrollers using the BASIC language format.

    A look at the language

    Syntax

    Basic statements come terminated by line endings unless there is a line continuation character. a super minimum BASIC syntax merely needs the LET, PRINT, In case & GOTO commands. An interpreter which executes software online by using this minimum syntax doesn't want the stack. A select few early personal computer implementations were this elementary. In case of these adds a fold, nested FOR-loops & the GOSUB command may be added. An interpreter sustaining these features takes a BASIC code to own line totals.

    Line counts were the super distinctive aspect of classic page computer BASIC. Alas, the have of line totals has a disadvantage of requiring a computer programmer to guestimate ahead of program entry how else numbers of lines a given program section may require. This require is virtually all typically met by habitually incrementing serial line statistics by a regular interval, say Ten, however naturally leads to problems when soon when later on-added code exceeds a total-space available between the original lines. To alleviate this condition using early BASIC interpreters, good users before long wrote their have service program for renumbering their software online fallowing initial entry. a select few BASIC interpreters later on appeared by having a built-integral RENUMBER command, so eliminating the virtually all urgent condition sustaining line prices.

    A few (but not totally) modern BASIC idiom use at times abandoned line prices, & trend lines virtually everthing (or even all) of the integrated control & information declaration constructs known inside more languages prefer C and Pascal (note also that a few advanced versions of line total-depending residence computer Fundamentals incorporated such constructs when these to practiced result): wash - loop - when - until - exit in x goto / gosub (switch & case)

    Recent variants like Visual Basic have introduced object-oriented features, such as a For Both...Loop construct for looping across collections & arrays inside VBA & Visual Basic Four & late, & potentially inheritance in the latest version. Memory management is more comfortable than inside numerous more procedural programing language because of the unremarkably involved garbage collector (presumably for which, however, of these pays the dog-period performance penalty).

    This wealth of variants shows that a language is an "organic" one and that it can be seen as a subculture treating using computer programing like than as a fixed placed of syntactical system. This applies also to more "old" machine-oriented language such as COBOL and FORTRAN, although a BASIC movement is by far a largest; this can be explained per prominent total of IT agents world health organizatiin cut their dentition on BASIC programming when you took the house computer era in the Eighties.

    Procedures and flow control

    BASIC doesn't have a standard external library like more languages such as C. Instead, a interpreter (or even compiler) contains an extensive built-inherent library of intrinsical procedures. These procedures include virtually all of the information the coder needs to see programming & write elementary applications, including functions for mathematics, strings, console input/output, graphics & file manipulation.

    A select few BASIC accent don't allow coder to write their have procedures. Coder must instead write their software using heavy many GOTO statements for branching. This may symptom inside super confusing source, normally known as spaghetti code. GOSUB statements branch to elementary sort of subroutines without (sometimes by having) parameters or even local variables. Virtually all modern versions of BASIC like Microsoft QuickBASIC have added support for fully routine & functions. This is an additional front yard in which BASIC differs from either numbers of more programing language. BASIC, such as Pascal, makes the distinction between the procedure which doesn't link to the value (known as the routine) & the procedure which does (known as the work). Several more languages (notably C) produce there are no distinction & assume all about the work (using occasionally giving the "void" value).

    When functions in a big feel of routine giving values were the latecomer to BASIC accent, numbers of early systems supported the definition of 1-line mathematical functions by DEF FN ("DEFine FunctioN"). A original Dartmouth BASIC too supported Algol-prefer functions & routine from either an early date.

    Data types

    BASIC is easily known permanently string manipulation functions. Early idiom already experienced the placed of fundamental functions (LEFT$, MID$, Correct$) to treat sustaining strings easy. Because strings come typically utilized around everyday applications this was a considerable benefit across more languages at the instance of its introduction.

    A original Dartmouth BASIC supported merely numeral & string information types. There was there is no integer type. Wholly numerical variables were floating point. Strings were moral force within length. Arrays of both prices & strings were supported, likewise when matrices (deuce miscreate arrays).

    Each modern BASIC accent at least has a whole number & string information types. Information types come unremarkably distinguished by the suffixed character; string identifiers prevent around $, whereas whole number classically ended by owning the '%'. Inside occasionally idiom, variables must exist as declared (sustaining DIM) in their number 1 usage; more accent don't take it, however might optionally enforce it—usually applying the directive like Stock Explicit (within VB.NET it is on by default but can be turned off using Option Explicit Off). Several accent too trend lines such extra types when 16- & 32-bit whole number & swimming-point figures. A few stand "polynomial", "complex", "list", & specialised types for the meant utilise of the implementation. In addition, occasionally allow user-defined types similar to Pascal "records" or C "structs".

    Virtually all BASIC accent beyond a virtually all primitive likewise trend lines arrays of whole number or even more types. Around a select few, arrays must exist as pre-allocated (by using a Dimmed statement) prior to it may be utilized. Trend lines for both- & higher-dimensional arrays, likewise when arrays of non-integer types, is park.

    DIM myIntArray (Century) When INTEGER DIM myNameList (L) When STRING

    Based on the idiom of BASIC & utilize of the Stock Base statement, values could range from either either either myIntArray(Nought) to myIntArr(One c), from myIntArr(Single) to myIntArr(C) or even from myIntArray(LowInteger) to myIntArray(HighInteger). Yet, around Visual Basic .NET, everthing arrays come zero-indexed, meaning a foremost element hwhen an stock of Zero, as in the number 1 of the above examples.

    Relational, logical operators

    = match <= less than or equal NOT logical negation <> non equal >= greater than or even compeer & logical conjunction < less than OR logical disjunction > greater than

    Note that no lexical distinction between a assignment operator & a equality operator around BASIC; one equal sign is used for both. There exists, nonetheless, a method available to a computer programmer whenever the seeable difference between them is wanted: the optional LET keyword allows for assignments to become clearly & unambiguously distinguished from either the have of the equality operator. Case: Whenever X=Septenary So LET Y=Iii.

    Simple, concise examples

    Hello world!
    A archetypical Hello world program: X PRINT "Hello, world!" 20 END

    Original vs. Modern style
    Sample I: Original BASIC (Applesoft BASIC). Note that this case is actually swell structured, demonstrating that utilise of the GOTO statement doesn't necessarily lead to an amorphous program.

    Decade INPUT "What is your name: "; U$ Xx PRINT "Hello "; U$ Xxv REM Xxx INPUT "How many stars do you want: "; N 35 S$ = "" Forty FOR We = Unity TO N Fifty S$ = S$ + "*" 55 NEXT I Sixty PRINT S$ 65 REM Seventy INPUT "Do you want more stars? "; The$ Eighty Whenever LEN(The$) = Zero So GOTO 70 Ninety The$ = LEFT$(The$, Ace) One c Whenever (The$ = "Y") Or even (The$ = "y") So GOTO 30 110 PRINT "Goodbye "; Great hundred FOR We = 1 TO 200 130 PRINT U$; " "; 140 NEXT I 150 PRINT

    Sample Two: "Modern" Structured BASIC (e.g. QBasic) replacing GOTO statements by more modern keywords.

    INPUT "What is your name"; UserName$ PRINT "Hello "; UserName$ DO INPUT "How many stars do you want"; NumStars Stars$ = "" Stars$ = Repetition$("*", NumStars) ' <- ANSI BASIC --or-- Stars$ = STRING$(NumStars, "*") ' <- MS BASIC PRINT Stars$ DO INPUT "Do you want more stars"; Answer$ LOOP UNTIL Answer$ <> "" Guide$ = LEFT$(Guide$, Single) LOOP Patch UCASE$(Guide$) = "Y" PRINT "Goodbye "; FOR I personally = 1 TO 200 PRINT UserName$; " "; NEXT I PRINT

    View UBASIC for comments on structure.

    Availability, lineage, tools

    BASIC dialects
    BASIC is available in about each microprocessor platform processed. Of these interpreted loose version, compliant by having standards & extremely cross-platform, is Bywater BASIC (bwBASIC). A interpreter is written around C and comes under a GNU license. These are intended for text console software online, & per se doesn't include the builder for creating graphical user interfaces (GUIs). The loose BASIC that includes the GUI builder, diarrhea in Linux and Windows and is similar to Visual Basic is Phoenix Object Basic.

    can now become utilized instead, a syntax is a nearest imaginable to QB & the console & graphic statements come besides supported.

    More versions include (PowerBASIC's) PowerBASIC programming language, when well as (True BASIC's) True BASIC, which is compliant with a latest official BASIC standards. (Admittedly BASIC, Inc. was based per original creators of Dartmouth BASIC.)

    REALbasic, for Windows, Linux & Apple Macintosh, occurs as modern, object-oriented variant that generates executables for Microsoft Windows, Macintosh and Linux. REALbasic creates compiled code and generates native applications. REALbasic is very similar to Visual Basic so VB computer program may be ported well.

    The elementary BASIC accent for the parrot virtual machine shows a BASIC interpreter implementation inside an assembly-prefer language. PureBasic is a variant with elementary syntax that produces convenient, lilliputian viable files for Windows & Linux, & is within addition capable of compiling in-line assembly videos. A SmallBASIC dialect runs in numerous platforms (32-bit Windows, DOS, Linux & PalmOS) & comes by owning the Wildebeest license (GPL).

    "Business Basic" is the name given conjointly to the variants of BASIC which were specialised for business utilize in mini-computers in the Seventies. Business Basic principles added indexed file access methods to the convention placed of BASIC commands, & were optimised for more input/output access. Them major families of Business Basic were MAI BasicFour, and Data General Business Basic. In the Eighties, Business Basic principles were ported from either their original proprietary environments to numerous Unix platforms, and to DOS.

    More variants include RapidQ, a loose cross-platform BASIC compiler using extra capabilites for console and GUI programming.

    An additional genre of programming in which specially tailored BASIC variants stand appeared is computer game creation, some examples dialects/products existence Blitz BASIC, DarkBASIC, PureBasic, Antiryad Gx.

    There has too been a select few non-English BASIC variants, such as Chinese BASIC.

    Predecessor languages
    FORTRAN ALGOL

    Derived languages
    COMAL (misc. pc) OPL (Psion PDAs)

    Cross-language tools
    BCX (Win32, BASIC to C translator)

  • Full Moon Software
    offers add-on products and utilities for several Basic languages for DOS. The entire catalog and some demo programs are available for download.

    Phoenix Object Basic
    A unique object-oriented RAD tool for Linux.

    GFA Basic Windows Programming
    This site is designed to give users of GFA Basic Windows help. It has a beginners section where no previous knowledge is required, an amateurs section where you can improve your skills and an experts section where you can find out about advanced programming techniques.

    O'Basic
    Visual Script Language for Windows95, 98, NT and 2000.

    The BASIC Archives - Home Page
    A very complete BASIC FAQ page with many links to other BASIC sites.

    History of BASIC
    A history of one of the most commonly used programming languages.

    MoonRock compiler
    A free compiler for a Basic-like language, with QuickBasic source code.

    HTBasic
    BASIC for Windows, Linux, HP-UX and DOS. MS Office integration. GPIB and GPIO interfaces. VXI solutions. HP 700 add-ons. By Tech Soft GmbH.

    MBasic
    A fast Basic interpreter for Windows consoles platforms based on Sylvain Bizoirre's Mini Basic language. Assembly sourcecode is included.

    KBasic
    Provides an implementation of the "Basic" programming language for KDE. Describes the programming language as well as available and planned applications to support it in KDE.


    Computers: Programming: Languages: Interpreted: Procedural
    Computers: Programming: Languages: Open Source
    Computers: Programming: Languages: Procedural




    © 2005 GeneralAnswers.org