Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Many of us, including me, started their programming life with programs written on home computers, something like

60 IF A$="Y" THEN GOTO 10
70 END

Of course, the line-number based BASIC was prone for creating spagetti code, also because most BASIC dialects missed structural statements like WHILE, doing everything but the FOR-loop with IF, GOTO and GOSUB. I'm talking about BASIC dialects before 1991, when QBASIC and Visual Basic appeared.

While BASIC dialects may have promoted bad style amongst aspiring programmers, were there larger commercial projects created in such a BASIC dialect? If so, how did they manage to live with and workaround the obvious shortcomings?

By "serious", I mean:

  • Not a game (I know some commercial games were written in BASIC, for example, Pimania)
  • Not freeware
  • Not trivial, that is, reasonably large (say: at least 1500 LOC)
  • Sold to several customers (not an in-house development)
  • "Mission critical" is a plus
share|improve this question
Were those BASIC dialects only used to teach aspiring programmes bad style Hm... It's bad style now but it wasn't back then. –  Yannis Rizos May 21 '12 at 10:10
Dartmough BASIC was designed in 1964 (and it was a compiled language, interestingly), an era dominated by FORTRAN. –  Yannis Rizos May 21 '12 at 10:40
Assuming you are attempting to calculate the circumference of a circle, style is not the only bad thing I see here. –  William Jackson May 21 '12 at 13:31
I'm seriously pissed off that this question was closed during the "History" contest. Heh, you missed a great opportunity to get some extra views for the question by bringing it up on Meta. –  Yannis Rizos May 22 '12 at 11:19
99% of all software that is written are line of business apps written in house, and by definition makes them about as serious as you can get. –  Jarrod Roberson May 22 '12 at 14:55

22 Answers 22

up vote 38 down vote accepted

Sure. Before the Altair/MITS/SWTPC/Kim/Sinclair/Pet/RadioScrap/OSI/Apple things happened, there was a delightful little machine known as the IBM 5100. It had BASIC in ROM, a big cassette tape drive (or two), 8 KB of memory. a 24 line screen, and a printer, all for a measly USD 10,000 -- an order of magnitude cheaper than your typical mini. Originally built for scientists (APL in ROM was also an option), but then a few accounting types discovered it, and started a craze: every small business wanted one. With custom software, of course. The 5110 followed that, with the tape drives replaced by 8" floppies.

Any commercial software? Galoons.

Can you say general ledger, payroll, accounts payable, accounts receivable, inventory control, and invoicing? I have been there, done that -- in BASIC. Utility bills, new and used car inventory, garbage truck pickup and beverage delivery scheduling? Yup -- BASIC. Want to track iron ore from mines onto trains onto ships... BASIC. Everything that wasn't raised floor was likely getting done in BASIC. Commercially, I mean. (Because RPG II doesn't count ;-).

How did one work around the limitations?

Well, the first thing you did was send the customer back to IBM for more memory, Because who could write anything serious in 8 KB? You simply had to have 16. And two tape drives, if possible, because automata theory aside, merge sorting on a single tape is, well, a tad slow.

Oh, sorry - you meant the limitations of BASIC.

Well, you had to manage your resources pretty carefully -- things like line numbers -- because you didn't want to run out of those; real pain in the behind to have to renumber a whole section, and type it all back in, without accidentally losing a line or two of code.

Nah - just kidding. We didn't actually have that problem until micro---er, home computers showed up, with a BASIC interpreter that couldn't do renumbering by itself.

We also used modularity - where you called a new program, ran it till it quit and returned back to the calling program. A gosub on steroids (because you got more memory to use), but way slower (because it took a while for the machine to find the program on the tape, and load it in, and then rewind and find the original program and load that back...). A lot like a fork and exec, but without the fork, only better because the whole memory space was shared.

Rigorous use of conventions also helped -- you know, like "you MUST always target a GOSUB at a comment line that says what this routine does, and you SHOULD do the same for a GOTO when possible. Stuff like that. Oh, and structured programming, a little later -- "by convention" again.

Some even went a little to the extreme: OAOO, YAGNI, TSTTCPW, pairing, refactor mercilessly, that sort of stuff. Not by those names, of course. (See also: Ecclesiastes ;-)

The glory days.

share|improve this answer
From all the good answers, I choose this one because it hasn't got too much love (upvotes) yet and also because it highlights the use of BASIC for commercial software on microcomputers before the rise of the homecomputers. –  user281377 May 28 '12 at 18:28

The first software I ever worked on was an 8k line GW-BASIC program that the company wrote back in the 80's to use heat transfer calculus for sizing and pricing boiler equipment. While the code was completely incomprehensible, it managed to work so well that they had used it for over 20 years.

This was the strength of BASIC that a mechanical engineer with a reference manual could actually write quality usable software (at the time). Before BASIC and the prevalence of the PC, such a thing would have been unheard of. You would need to hire a team of computer engineers and possibly computer operators to program and work off of a shared mainframe. All of this would have been far too complex for the typical mechanical engineer to pick up in a short amount of time.

So certainly BASIC was highly useful beyond home computer enthusiasts, this was many businesses first introduction into the realm of writing custom software inhouse for an affordable price without teams of experts.

share|improve this answer

Yes, there were numerous commercial products and other "serious" development done in BASIC. To understand why, you have to understand the context of the 1970s and 1980s, when BASIC grew on mini- and microcomputers.

Back then, the machinery was positively scrawny by today's standards. CPUs were clocked at a few MHz (often much less for microcomputers) and had less memory than would be occupied by the HTML it takes to render this page. If you were going to deploy a product, you had to use the tools that were available, which was either bare-naked assembly or, on microcomputers, the BASIC interpreter that shipped in ROM (often 16K in a 64K address space) with the system. There were other languages available, but many didn't have all of the structured features we take for granted. This had a lot to do with the fact that memory was scarce,* none of it was virtual except on very-high-end systems and there usually wasn't enough of it to hold a compiler for a more-sophisticated language. With such limited resources, "serious" was a relative term, and we simply weren't throwing the kinds of jobs at computers that we do now with plentiful processing, memory and storage.

Your argument that the makers of early home computers should have known better and provided a structured language just doesn't work in that context. It simply wasn't going to happen with the available technology at a price people could stomach.

How we got around the language shortcomings was simple: we didn't see them that way and got the job done with what was available. ANSI Minimal BASIC is structured a lot like assembly language in that you get most of the same flavors of simple branching and subroutine calls, but it's up to you to make sure the stars are properly aligned. The sole exception is the FOR..NEXT construct used to provide looping. Essentially, if you wanted to develop something in BASIC and do a good job of it, you had to plan out and understand the structure of your programs just as carefully as if you were writing them in assembly. The available debugging tools were very primitive, so, in essence, you had to have your act together if you wanted your programs to work and be maintainable.

Yes, there was a lot of spaghetti back then, but I have yet to see a language where it's impossible to write bad code.

*Memory ran about US$750-1,000 per MB in the early 1980s. Adjusted for inflation, that's US$1,600-2,200 in 2010 dollars. That same year, the cost per megabyte was about US$0.03.

share|improve this answer

My first 100% programming job, back in the 1980s, was working on a vertical market accounting package that was originally written in GW-BASIC. It had been ported to QuickBASIC 3.0, but it retained almost all of the faults associated with early BASIC dialects. There were tons of GOTOs and a lot of poor structure. There were about a dozen modules (inventory, ledger, etc.) and the program sold for about US$1000 - US$2500 per module plus annual support contracts. Company revenue was in the US$15 - US$25 million a year range.

As for how to live with shortcomings, a lot of limitations were gotten around by using machine language or MASM. It was common to use PEEK and POKE commands to insert machine language into BASIC programs. I wrote MASM (and later C) programs to extend the program to add things like rudimentary database support, communications and text "graphics".

share|improve this answer
I pity you, unless of course, you got in on the 15 mil. –  Spencer Rathbun May 21 '12 at 13:34

Peachtree Software's entire accounting line (accounts receivable, payable, etc.) were all written (and still might be, for all I know) in BASIC. When the IBM PC was first rolled out I spent many a long evening debugging and fixing their code for customers that bought an IBM Personal Computer and the Peachtree packages to do the books for their small business.

share|improve this answer

My first job was in 1981 programming Apple IIs in Basic at a Price Waterhouse (Pre Coopers) office in their management consultancy in Belfast, N. Ireland. A team of two/three of us developed and installed systems in clients including a bookshop and a slaughterhouse. It was a financial modelling system, effectively a very complex Visicalc spreadsheet (50 sheets, 3,000 variables) turned into a large Basic program. It took two days running on an Apple II system with 4 disk drives to process a week's throughput at the slaughterhouse. A bit quicker than their manual system that had taken two man weeks for each week.

We then moved onto Act Sirius machines, again programming in Basic (the Microsoft 8KB Basic) which were installed in clients.

The Basic had line numbers but there was a toolkit that could renumber programs. As I was fresh out of Uni where I had learnt Pascal, I tried to write in as structured style as possible (as much as you can in Basic), but Gotos and Gosubs were of course used.

I later programmed in 1983 on Dec Rainbow which used CBasic, a clunky compiled basic.

share|improve this answer

There was a lot of commercial software written using BASIC-PLUS on the PDP-11 systems. I remember seeing statistical analysis and accounting packages, plus a fair amount of high-end laboratory automation stuff (I am not sure how "commercial" those were. They tended to be included as part of an instrument package, so I don't know if they were sold separately.). ISTR BASIC was one of the primary languages for HP 2000 application development as well, and it was the primary (possibly only) language supported for their early HP 9800-series workstations.

share|improve this answer

Were larger commercial projects created in such a BASIC dialect?

On older home computers like the C64 or its predecessors, there existed a lot of BASIC programs, and also some commercial ones. But "large" was seldom possible, since with <64kB of RAM writing "large" BASIC programs is not really easy. If you wanted to come around the limitations of the machine, you typically had to leave the ground of BASIC, the "high level language", and use assembler.

So the answer to your question is "probably not many", but not because of the reasons you have in mind (like "too error prone / unstructured" etc).

By the way: AFAIK the famous PETSpeed BASIC compiler was written in BASIC (compiled with itself, of course).

share|improve this answer
I'd like to point out that important != large, especially back in those days. Today, commercial programs tend to have every imaginable feature built in, but that wasn't always the case. –  Jeanne Pindar May 21 '12 at 13:22

Alpha Software's early DOS database products (circa 1985) "Database Manager I", "Database Manager II" (DMB2) and "Alpha Three" were written in BASIC and compiled with the IBM BASIC compiler. I worked on "Alpha Three". All the UI was in BASIC but it had a core TSR (terminate and stay resident) component written in C and ASM that the BASIC communicated with via interrupts. Line numbers and line breaks took up valuable segment space so code was horribly squished and unreadable. We used shared variables and swapped modules constantly. It was hard to make work. We still tried to be logical about organization however so our string library was all in the low 60000 line numbers. A common operation like trimming a string would look like:

$S=$INS;GOSUB 60210;$INS=$S;

We converted to all C shortly after the release of "Alpha Three".

share|improve this answer

In the early 1980s the U.S. Air Force bought a bunch of Cromemco S100 bus computers for use by flying squadrons as a flight planning tool.

The flight planning software was developed using BASIC by Air Force pilots and navigators at the Tactical Air Warfare Center, located at Eglin AFB, Florida.

As far as working around the "the obvious shortcomings" of BASIC, we really didn't know any better. Just giving physical access to a computer to an aircrew seemed like an incredible leap of technology at the time.

share|improve this answer

I believe that the original Ultima on the Apple ][ was written in Applesoft Basic.

DEC used its version of BASIC for much of RSTS and other OSes it developed.

share|improve this answer

Absolutely yes.

Long long ago, I worked for a company that sold many million of dollars of systems, mainly to the auto dealer industry. These systems ran BASIC software on customized 16-bit HP 21MX minicomputer derivatives (before the era of successful 16-bit microprocessors). This was a medium size company with dozens of Basic programmers. They used an old fashioned BASIC dialect which required line numbers and only allowed 286 possible variable names, and yet the solutions provided all the business accounting and inventory (etc.) for medium sized businesses. The R&D group also wrote assemblers, compilers and even hardware emulators in Basic to help bootstrap development of their next generation hardware.

When attempting to explain what I thought were the benefits of more modern programming and hardware design methodologies to one old timer, he told me that good designers properly partitioned, modularized and structured the solutions to their problems, even if direct expression of such was not built into the language or tools, whereas, he noted, bad designers can produce un-debuggable garbage no matter what "fancy" fashionable development paradigm they work inside.

share|improve this answer

Fact is, most of the new car dealers in the U.S. today use BASIC programs to quote you financing options and to create those long settlement statements you get when you buy a car. The programs are written in archaic minicomputer versions of BASIC running under emulation on modern hardware. There are web UIs grafted on, but its BASIC talking to a tty underneath.

Around 1980, universal life insurance became an instant fad in the life insurance business. Every company wanted to sell it right away, and it required that account values be computed for each policy every month using a very complicated combination of interest and actuarial mumbo-jumbo. As big projects in data-processing departments would take about a year back then, many companies went into production with as many Apples, PCs, and/or Tandy TRS-80s as needed doing the more complicated version of what had been on mainframes for about 20 years. Virtually all of these were programmed in BASIC. Mostly the BASIC used short-precision floating point, so millions of customers' pennies got lost in the rounding.

JPL had a version of BASIC it used extensively back about 35 years ago, too. It was called MBASIC, with the M standing for management, but it was used, among other things, to program spacecraft.

share|improve this answer

IBM's hugely popular 4680/4690 retail point of sale system was written in a dialect called IBM 4680 BASIC. I worked on this system from 1998-2002 for a major UK retailer.

This system was very popular, according to the wiki article it still held 12% of market share in 2005. The system is still going strong today, odds are good that most people in the western world have indirectly used this BASIC powered system in the last week.

share|improve this answer

The only fear that I've had, as a QuickBasic programmer, 20 years ago, was "Out of memory" message. But this only made me a better programmer! I've learned how to write compact, and serious code.

I used to use QuickBasic for industrial programming. In the real world (factories) you cannot tell your boss "it's going to take half year to be written in C"; you can only say: "yes boss, it'll be ready next week". Yes, BASIC was the practical-and-quick solution in the real world. Not C or Pascal.

One of the programs I've written in QuickBasic 4.5, a unique database, was sold to few companies, and actually replaced the commercial database that they already had (which was probably written in C or Pascal). This database is in use until today.

One subject that I want to mention:

we all think that new programming methods are so much useful. But in the real life (industry), most machines, these days, are operated by modern PLC. The programs are usually written in ladder programming, which is million times more primitive then GW-BASIC. As a programmer for PLCs I can say clearly: I would love to replace this primitive ladder programming with high level language as GW-BASIC or even QuickBasic. (MEGA-BASIC is a dialect that was used for this purpose in the past).

After all, what most machines are doing? interpreting inputs and setting outputs. You don't need C/Assembly for that, and you don't need Java. You surly need QuickBASIC to create a maintainable code.

share|improve this answer

Look into PICK or any of the other MultiValue databases. They all rely on DataBasic as their main or only language and have a significant vertical market usage. We still run a system I wrote for procurement benchmarking over 20 years ago. Runs to about 50k lines of code.

share|improve this answer

There was a company called Softek in India in the 80s that created their own versions of Wordstar, dBase and Lotus 1-2-3. Another of their products was a BASIC compiler.

Using their own CBASIC, they created a very comprehensive double entry accounting package called SIMS-FA (Softek Financial Accounting).

share|improve this answer

Any? Yes. Many? No. Educational software and record-keeping.

The BASIC era: ~1970-1990

Up until about 1990, limitations exceeded expectations and evolved with the industry needs. For the most part, needs of larger companies were analyzed by consultants and met with whatever language that fulfilled the need.

Rather like today, where companies have a more or less developed idea of what they need and have some sort of solution be built with VBA, and then learn enough to discover more competent client-server solutions, web apps, and optimized interfaces with data grooming.

In the 1970s, if a regular company could balance accounts or register production figures on the computer without the budget of a corporation, it would be a great step up from keeping books, and if you could get a diagram out, that was fantastic.

In the 1980s, if you could migrate some product drawings to the computer to make them editable, that would also be fantastic.

Both these could be done with an interpreter-based language. As computers could hold more data, complexity required compilers, because CPUs fell behind Moore's law in raw data shuffling performance from around 1977 to around 1987.

But up until the end of the 1980s when expectations demanded more, the languages established in the 1970s (complemented in rare cases by Assembler and/or custom hardware like FPU boards) did all the serious, commercial work in companies with few exceptions. Cobol and Fortran was the still the ticket on mainframes. Only corporations could afford such, and serious companies did what serious work they could with in-house BASIC programs, and for a while this was enough.

Standalone software packages for general use such as word processors or diagram plotters came along at around this time, when operating systems had matured on affordable computers as targets for compilers, and storage emerged that could hold "company size" documents and data.

Pascal was a major contender here. Previously, almost all such had been written in Assembler. Finally C came over from Unix and started being used on PCs.

share|improve this answer

Back in the days of the Commmodore 64 part of the game Gunship was written in BASIC. You could even edit the code, so your helicoper could be equipped each time you landed.

share|improve this answer

BBC BASIC originated on the BBC Micro, released in the UK in 1981. By the time it reached version five, as implemented on Acorn's ARM-based RISC OS computers, it was considered the fastest interpreted BASIC in the world. Its syntax was advanced for its time, including structural keywords like CASE and WHILE and functions and procedures. (It even included an assembler, originally for 6502, and then for ARM in the RISC OS versions.)

Many commercial desktop applications were written using it, perhaps largely because it provided convenient access to the SWI calls that the cooperative WIMP system used. It was fast enough that there were even some arcade games written using it -- Nevryon, an R-Type clone, is one I particularly remember looking at the source of.

share|improve this answer

The old xBase database scripting languages (as in dBase II, dBase III+, Clipper, etc.) were quite closely related to the various non-standard BASICs of the time.

Not exactly BASIC being used for commercial work, but maybe close enough.

share|improve this answer
@user281377 The original version of the answer was mentioning Visual Basic (where did you get QuickBasic from?), that was what I was screaming about ;P –  Yannis Rizos May 23 '12 at 22:41

Most micros only had basic (ROM) or assembler development tools. For non-speed-critical programs BASIC was used for many commercial applications as well as most in-house company projects. Even when CP/M came along the only real enhancements were the ability to handle bigger projects and use Microsoft's basic compiler (BASCOM). My own experience with early micro development was as follows:

~1980 - Microsoft ROM basic on a Nascom 2 with a little assembler. Commercial application development included a VAT (sales tax) return program and a process control program (both in BASIC).

198? - Still using BASIC, but I now also had Pascal (BLS - precursor to Borland Pascal).

Mid 1980s - PCs begin to dominate and first C compilers appeared (Hisoft and Mix). BASIC goes into decline (revived later in zombie form of course by MS with Visual Basic). GW-BASIC was very popular as an in-house development tool. Numerous commercial packages (accounting, stock control, etc.) was still written in BASIC.

Late 1980s - C becomes the main development language (after MSC 5 released 1986?). Microsoft and Borland dominate for next few years...

share|improve this answer
how does that answer the question? –  gnat May 23 '12 at 16:53

protected by gnat May 23 at 15:36

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.