Wiki re-wording for "XBase", which is a general term for languages and tools derived from the Ashton Tate dBASE product, popular in the 1980s and early 1990s. Clones include
FoxPro, Quicksilver, dbXL, and a compiled dialect called Clipper (which spawned
XbasePlusPlus,
FlagShip, and Harbour). XBase originated as a table-oriented non-SQL language and tool vaguely influenced by relational theory and (mainly) cursor-oriented table navigation techniques from the 1960s. It was one of the first products that easily allowed small businesses access to database concepts such as ad-hoc queries, indexing, and data-driven
CrudScreen RAD when microcomputers were just coming of age. Jim "Button" Knopf's "PC-File" exhibited similar capabilities, albeit with less programmability.
It allegedly has its roots in a legacy database product called RETRIEVE. The Pasadena Jet Propulsion Laboratory, famous for planetary probes, didn't want to pay licensing fees for RETRIEVE and so set out to create something similar. In a round-about way, it eventually wound up a commercial product for CPM microcomputers, and grew quite popular in the DOS world. Much of the history of the product was discovered during court testimony related to lawsuits by Ashton Tate to prevent clones of the product/tool. It turned out that Ashton Tate's view of history was not entirely accurate, and the history of
ExBase was deeper than their original story.
Its demise in popularity has been attributed to one or more of the following:
- Lawsuits over its origin in the early 90's frightened away development commitments and committed developers.
- Vendors could not produce decent GUI versions in a timely manner after Windows 3.x made GUI's popular in business settings. (Ironically, the Mac had a GUI version in the mid 80's, but the GUI engine was not ported over to PC's for some reason, perhaps because of the OOP revamp plan described below.)
- Not based on SQL (although SQL-based extensions were eventually added to some dialects.)
- Standard was splitting because various vendors wanted to take it different ways and/or didn't cooperate.
- DBaseIV release was preceded by significant marketing hype, then was delayed, then proved slow, unreliable, buggy, and a memory hog. This destroyed developer and management confidence in Ashton-Tate and their products. In the late 80's, I attended an Ashton-Tate presentation on the forthcoming DBaseIV. The presenter started by soliciting comments from the audience: "What would you like to see in DBaseIV?" The response to every comment was "DbaseIV does that!" Of course, it didn't. The cynical feeling among many developers was that Ashton-Tate expended more development effort on the funky animated ASCII splash screen than on the product's core functionality.
- Issues with IV made our shop switch to Clipper for bigger projects. Fox-Base, FoxPro's predecessor, was also coming on the scene around this time.
- If I'm not mistaken, one of the reasons for all the bugs in IV was because they converted the base from assembly to C. Thus, they spent most effort on internal language conversion instead of new features and fixing bugs.
- Project Scaling - Various language quirks and limitations made developing and maintaining large projects (e.g., those with over fifty tables and hundreds of forms and/or reports), especially in teams, an ordeal.
- Variable and "mode" scoping and context rules that simplified small projects created difficulties for formal libraries and larger projects.
- Perhaps it's a case of using-the-wrong-tool-for-the-job. KnowTheToolsNiche. People started trying to make it into a "big-project" language/tool when that may not be the proper niche for it. It's optimized for relatively small projects by design. But if a bigger project stuck to certain conventions, perhaps enforced with a standard "setting" top (header) call, and used tables as the main cross form/report communication technique, there shouldn't be lots of problems. It's when developers approached it like they would "C" where most problems seemed to arise from. It's somewhat comparable to PHP - If a project grows past a certain point, then you just have to enforce certain standards and conventions. "Enterprise" languages protect one more, but are also more bureaucratic. I doubt any language shines in all project and niche sizes (unless it is so configurable as to not have enough of a target audience to survive.) In some ways, ExBase is a table-oriented HackerLanguage.
- OOP:
- Alleged OOP hype made it non-cool
- Attempts by dBASE's owner to add OOP features delayed a GUI-friendly product release
- OOP extensions took it in a different direction that didn't really fit in with its root table-oriented philosophy, making attribute-driven interfaces fight over territory with OO behavioral-driven interfaces.
- Lack of genuine OO capabilities (until too late) drove developers interested in OO in other directions.
Other products such as Visual Basic, Microsoft Access, Paradox, and
PowerBuilder eventually replaced its niche. Some feel the XBase vendors should have expanded on its table-oriented nature and used
ControlTables for event handling and GUI properties rather than try to copy OOP techniques popular in other GUI tools. An opportunity to go down a unique path was allegedly lost, and instead they tried to be a me-too product in an arena that was too different from the root table-oriented philosophy of the tool. You can turn a leopard into a tiger, but not into a gazelle. (
FoxPro and
VisualFoxPro actually use
ControlTables for many GUI aspects, but it is generally an
UndocumentedFeature.)
The language gives one the feel of being "inside" database tables. It is heavily context-based because of its interactive origins. The plus side of being context-based is that less code is usually needed to indicate what is being operated on, and it made it easy to learn and debug using the interactive mode. The downside is that if not used carefully in longer modules, it can cause great confusion.
An interesting feature is that iteration over a table was built into the language. A general form of the syntax is:
do_x // operate on current record
do_x all // operate on all records
do_x for <expression> // operate on records matching the expression
(Actually "&&" is used for comments instead of slashes, but that might confuse the reader here. Also, not all dialects allowed such on user-defined routines, but only built-in ones.)
If you needed the same filter on multiple operations, then
FoxPro and some other dialects introduced the "scan" construct:
scan for <expression>
do_something
do_something_2
endscan
One could also apply a filter for multiple statements:
use <table> // open a table
set filter to <expression>
do_something
do_something_2
scan
do_something_3
endscan
etc...
set filter to // turn off filter
Some might consider this approach inferior to "scope blocks" or closures of some kind because blocking would guarantee that the filter does not accidently "stay on" if we forgot to close it, but the XBase approach
allows more interaction. You could use the same commands in interactive mode that you could in the programming code. Thus, with some copy-and-paste one could create a module out of their interactive session with only minor tweaks. One could also use a coded module to set up the environment, but then switch to interactive mode from that point on. That would be harder to do with scoped blocks because one must know the end-point ahead of time.
Early dialects required a fair amount of work managing indexes, but later dialects moved toward more automatic approaches where indexes were automatically opened and updated when a given table was opened or updated. Unfortunately, the newer approaches were not standardized. Generally the dBASE III+ dialect was probably the final version influencing a universal dialect. They diverged after that (although there was still some cross-borrowing). Thus, if one wanted to target multiple dialects, they usually stuck to III+ conventions.
Although many aspects of the language and tools are clunky, it has some interesting features that are hard to find in SQL-based tools. Many still consider it an excellent ad-hoc data transformation tool because it is usually easier to inspect intermediate steps and do incremental experiments with than with SQL tools. SQL has a more "batch" philosophy behind it.
Format Template Strings
One thing about
ExBase that greatly simplifies writing the validation in
CrudScreen applications is its format template strings. You didn't have to write a whole lot of validation code because the format string would guarentee the user entered only what the format would allow. For example, a phone number format template would look something like:
"(999)999-9999 \xAAAAA"
Here "9" is for digits and "A" is any alpha-numeric char. The "\x" escapes the "x" for phone extension since "X" was also a formatting character. (The specifics may not be entirely accurate here, I don't remember the details.)
The templates appear to be roughly barrowed from Cobol's character templates. The Xbase cursor would not produce a character that was not allowed in a given position. Thus, if you typed a letter where a digit was expected, the cursor simply would not move (and beep in some dialects). The "marker" characters, such as the parentheses in the phone number helped the user know where to type. The cursor automatically skipped over the marker characters.
It is one of those intuitive, useful, and life-simplifying features that you really miss when you have to do it the hard way. I hope
AjAx adopts them. Swing has added "J
Formatted
'Text
Field" that allegedly does something similar. Superficially it looks kind of limited.
Pro's
- DomainSpecificLanguage - Language designed with nimble database and business processes in mind
- What the hell is a "business process"? Sounds like pseudo science and a BuzzPhrase. Nimble database? What the hell is that? Premature optimization?
- Business Process definition: http://en.wikipedia.org/wiki/Business_process. They were initially described in 1776 by AdamSmith, so I do no think it is a BuzzPhrase.
- "A business process or business method is a collection of interrelated tasks, which solve a particular issue." A particular issue? Laughing my arse off. Gee, that is almost as clear as mud in my back yard. Sounds almost like saying "we do stuff, to fix stuff, with stuff".
- As a common example of "nimble", I think we can agree that MicrosoftAccess is more "nimble" than Oracle. Oracle is optimized for scalability and reliability, not nimbleness.
- Business processes are not reliable are they? That's good.. maybe FabianPascal will have some comments about TheWest again. -AnonymousDonor
- Do you mean actual business rules? They can often change in unexpected ways, yes. Related: AreBusinessAppsBoring.
- By "reliable" I meant more about database up-time and reduced data corruption, etc. ExBase tools are not well-suited for say a medical prescription tracking system, but rather a marketing database for a small-to-medium company on a tight budget and tight deadline.
- You're comparing apples to oranges. The apparent nimbleness of MicrosoftAccess is because the user's sole view of MicrosoftAccess is an administrative/development front-end for the (largely) SQL-based Jet database engine. What you see of Access is comparable to TOAD, phpMyAdmin, MySQLAdmin, pgAdminIII, and similar DBA tools. Oracle (at least Oracle Database) is comparable (in terms of nimbleness) to the naked Jet database engine, not MicrosoftAccess.
- Oracle also has development tools. Perhaps Oracle schema management could be done in a nimble way, but it is usually optimized for performance and availability and the practices in place for it reflect that; while Access is used when they want it soon and cheap.
- Cursor-Query-Integation - The cursor-friendly syntax allowed one to get a feel for the data incrimentally, to x-ray intermediate results, and to more easily integrate imperative algorithms with the query process. These are something that I find SQL does not do so smoothly (although it could be made closer to it by allowing user-defined or temp views and user-defined functions). SQL-based tools tend to have a heavy DiscontinuitySpike when mixing or changing between the query language and imperative (IF, looping, temporary variables, user-defined functions, etc). Sometimes imperative is just the TheRightToolForTheJob for some parts of processing. Other tools pretend this is not the case, making it difficult to mix the two concepts. Cursoring is also sometimes more efficient for certain algorithms compared to declarative queries under certain RDBMS. See IteratorVersusQuery for an example. Below is an illustration of updating a table in an imperative loop. This is something that other tools do not do conveniently. (Although an SQL UPDATE statement can do the same thing for simple cases, for more intricate logic it gets either ugly or inefficient, such as when different conditionals result in different behavior and/or when it helps to have a lot of temporary variables to reduce long or repetitious expressions).
&& Loop and Update Example
USE tableX
SCAN FOR &myFilterCriteria
IF x > y AND replacable
REPLACE x WITH y
ENDIF
IF a + b < c
REPLACE message WITH "Low"
ENDIF
ENDSCAN
- Typer friendly - (That's "typeR", not "type") It was designed to avoid having to type too much. This is especially useful for ad-hoc processing. One did not have type lots of qualifiers, quotes, braces, paths, etc. Plus, only the first 4 letters of the commands were required. I find that although mouse-centric tools are easier to learn, mousing is generally slower once learned than a well-designed key-board-based tool. Thus, the mouse-centric tools, like MS-Access make it easier to get up and going when first encountered, but one is not as productive under it. (Later versions added mouse-friendly features, but I saw little reason to use them often.)
- Reuse of commands for automation - ExBase commands can easily be turned into scripts via copy-and-paste (earlier versions did not buffer commands though). It is difficult to script the mouse in say MS-Access, requiring one to switch hats and reinvent the wheel when a repeated process needs scripting. Your prior effort and knowledge for the manual way of doing it gets lost when one goes from mousing to scripting.
- Integration of app language and query language - SQL-based tools often have a linguistical wall between the SQL and the scripting language that slows one down. ExBase's app language and query language used the same syntax conventions and commands for the most part. RDBMS-vendor-specific app and cursor languages such as Oracles PL/SQL sort of give one a similar feel, but they tend to be more formal and verbose than ExBase. PL/SQL was influenced by Ada, a compiled language, if I'm not mistaken; but ExBase is more scriptish and dynamic in flavor.
- Easy Reading - Because the sequences were represented as scripts, it's easy to print them out and see what is going on all on a sheet or two of paper. With MicrosoftAccess, you have to open and close gazillion different objects to follow the sequence.
Con's
- Index managing was either too manual, or differed per vendor. (This was less of problem with ad-hoc queries because one does not keep the indexes created anyhow.)
- Poor or lacking scope-management features: Its "auto-context" and mode-based scoping nature that simplified things for smaller processes made managing larger code bases more difficult. Thus, it was not a very good tool for writing complex packaged software developed by larger teams. (This is also partly because people tried to copy C's style rather than take advantage of table-oriented frameworks. One had to learn to "think in tables" to make better use of its idioms.)
- Either did not offer variable-length columns, or did not implement them well.
- Joins were usually more difficult in "cursor mode", but later versions let one use SQL for that.
- Variable names were limited in length (extra characters were ignored). However, this is not a fault of the concept, but merely a reflection of the resource-limited hardware it was built for at the time. (It was an amazing tool for something that fit in less than 100k for the earlier versions.)
Links
Appreciation site:
http://www.geocities.com/tablizer/xbasefan.htm
Interview with creator:
http://reddevnews.com/qandas/article.aspx?editorialsid=113
See Also:
CollectionOrientedProgramming,
PowerfulAdHocDataProcessingTools,
ModernizingExBase,
ExBaseRant
CategoryOldSoftware,
CategorySoftwareTool