Advertisement

An Easier Way to Create Software

Share
Lawrence J. Magid is a Silicon Valley-base computer analyst and writer

Today, most computer programs are written from scratch, one line at a time. But thanks to a new trend in software development called object-oriented programming, or OOPS, it’s possible for programmers to assemble programs from what amount to prefabricated modules. Ultimately, this could have a profound impact on the way we use computers and may someday make it possible for many computer users to create their own software, even if they know little about programming.

The easiest way to explain OOPS is by analogy. Imagine that you are building a car. You could start from scratch by designing and building every component such as body parts, tires, bolts and mirrors. That’s the way programs traditionally have been written.

Object-oriented programming, however, is more like the way cars are actually built. Auto makers focus design efforts on what the new car’s unique features will be, such as a body style or enhanced fuel economy, but most of the car is still assembled from existing parts. In fact, some of the parts, such as tires, spark plugs and rear-view mirrors, are purchased from other companies. In programming terms, these parts are objects.

Advertisement

This type of programming streamlines software development by allowing instructions from one program to be incorporated into another. If programmers want to, say, draw a box on the screen, they can use a box object from another program. If it’s necessary for the box to be modified, then some new instructions might be needed, but there is no need to create the box from scratch.

Object-oriented programming can also simplify the way software is used. Software can be written so that users manipulate objects rather than issue instructions. With today’s graphic programs, for example, it’s possible to use a mouse or arrow keys to draw or move boxes, circles and other graphics. Early graphics programs required users to enter physical coordinates to draw a box on the screen. The screen was divided into thousands of pixels, or dots, and it was necessary to specify the pixel positions for each line.

In concept, object-oriented programming isn’t new. Xerox pioneered it in the 1970s at its Palo Alto Research Center, and a number of companies have developed programming languages being used by academic and professional software developers. Software written for the Apple Macintosh, Microsoft Windows, IBM’s Operating System/2 and Steve Jobs’ new Next computer commonly incorporate OOPS techniques.

What is new is the availability of low-cost and relatively easy-to-use object-oriented programming languages for mainstream professional and amateur programmers. A programming language provides an environment and necessary rules or syntax for programmers to create new software.

Borland International recently announced an upgrade to its best-selling programming language, Turbo Pascal, that includes object-oriented programming techniques. Like other computer languages, Turbo Pascal is used by commercial software developers, programmers who work for companies and government agencies, students and hobbyists. Borland claims to have sold more than 1.5 million copies since it was introduced in 1983.

The new version, called Turbo Pascal 5.5, will be easier to use, said Borland President Philippe Kahn, because objects, once defined, can be used over again. In fact, just as in the automobile industry, it will sometimes be possible for programmers to speed up their software development by purchasing objects from other companies. In addition, TurboPower Software, a Scotts Valley, Calif.-based software company, has announced plans to market what it says is a library of “object-oriented routines that allow Turbo Pascal 5.5 programmers to write powerful applications faster.”

Advertisement

In describing the new version of Turbo Pascal, Kahn identified three key words to explain how object-oriented programming works: Encapsulation, Inheritance and Polymorphism.

Encapsulation combines programming code and data into a single object so that they can be manipulated simultaneously. When describing a car, there is no need to outline all its components and indicate how they work together. A picture or the word “automobile” encapsulates the parts into a single software object. Issuing instructions to manipulate that object are simplified. Rather than telling a driver to “remove your foot from the gas pedal, apply the brake, wait for the traffic to clear and turn the steering wheel 90 degrees to the left,” you issue the simple command “Turn left at the stop sign.”

Inheritance describes how properties can be reproduced. The Chrysler LeBaron comes in various models, but all share common characteristics. The convertible, for instance, inherits most of its traits from the standard sedan. Likewise, a programming object, once created, can spawn offspring that inherit its basic properties.

Polymorphism is derived from the Greek for “many forms.” An object can be instructed to behave in various ways, depending on its circumstances. An object defined as a box, for example, could be endowed with the ability to size itself depending on the size of another object in its environment. That capacity would simplify matters for a programmer who wants to draw a box around a picture. It’s as if an object is an intelligent robot endowed with some decision-making abilities.

The new version of Turbo Pascal is not for everybody. But it promises to be an excellent tool for professional programmers and serious amateurs. Users still have to wade through manuals and learn to write programming code, but there are millions of hobbyists who enjoy the challenge of creating their own software. At $149 ($50 if you own the previous version of Turbo Pascal), the Borland Package is a good opportunity for those who want an in-depth education into object-oriented programming. The program comes with a user’s guide, a reference manual and a detailed guide to object-oriented programming.

Corporate in-house software developers represent a major market for the new Turbo Pascal and other object-oriented languages. “Every Fortune 500 company,” said Kahn, employs programmers to develop specialized applications that are not available from commercial sources. A language that makes their job easier eventually benefits others in the company. Users who need special applications are more likely to get the software they need from their data processing staff.

Advertisement

In the future, it will probably be possible for non-programmers to use these techniques to create their own software without having to learn a line of programming code. Apple’s HyperCard for the Macintosh, for example, makes it possible to create simple programs by using the mouse to bring objects to the screen. Once they are on the screen, you can easily combine objects to perform a sequence of tasks. To do anything sophisticated, however, you need to learn the “HyperTalk” programming language, which still requires study and practice.

In introducing the Next computer, Steve Jobs promised strong support for object-oriented programming and demonstrated some simple techniques whereby users could control the computer by drawing lines between objects.

Despite these programming advancements, “the priesthood of professional programmers will never disappear,” Kahn said. There are some things that can be done only by what Kahn calls “software craftsmen.”

Thanks to companies such as Borland, my software library is a little bit like my tool shed. Both house some professional-quality tools. I write simple programs now and then and might use my saws and hammers to fix the back fence, but I’m not about to write my own word-processing program or build my own dining room table.

Computer File welcomes readers’ comments but regrets that the authors cannot respond individually to letters. Write to Lawrence J. Magid, P.O. Box 620477, Woodside, Calif. 94062, or contact the L. Magid account on the MCI electronic mail system.

Advertisement