100 percent pure OOP

By: J.D. Hildebrand

Abstract: Have you checked out Squeak? It's a new implementation of Smalltalk from the language's creators. By J.D. Hildebrand.

100 percent pure OOP

By J.D. Hildebrand

Today is the first day of The Bazaar, the Linux and Open Source conference in New York. Look for daily coverage of this event at Linux Today.

I was the editor of Computer Language -- now Software Development -- during the rough-and-ready 1980s. The programming world was different then. Once we devoted an entire issue to an in-depth comparison of a dozen C compilers for DOS. Professional programmers used Turbo Pascal and QuickBasic. IDEs were primitive then; real programmers used add-on editors and debuggers.

Objects to the rescue

Object-oriented programming was a branch of artificial intelligence in those days. No one expected to use OOP in real-world business systems.

But somewhere along the way OOP escaped from the lab. Studies established the benefits of objects, especially in large, complex development projects. Object-oriented programming tools proliferated and matured. The last straw was Windows programming, which required programmers to handle a much higher level of complexity. OOP was suddenly the right medicine. People began talking about Objective-C and Complete C, Actor and Eiffel, Loops and Flavors.

C++ and Object Pascal were gaining converts, but OOP purists dismissed them as "hybrid" languages. Unlike Actor and Eiffel -- "pure" OOP languages -- C++ and Object Pascal were plain old functional languages with OOP features grafted on. Like all the other pundits of the day, I voiced misgivings about the hybrid languages. Yes, they allowed developers to use the emerging object-oriented methods to improve their code...but they also allowed us to continue writing regular structured code. That, we said, was a bad thing.

You have to remember, OOP washed through the PC programming industry like a new religion. "Object-oriented" was essentially a synonym for "good," and "procedural" meant "bad." The fact that a C++ compiler would accept existing C code without requiring that the entire project be rewritten from scratch...well, somehow we thought that was a bad thing. We had bad hair then too -- check out the pictures. The 1980s basically defy explanation.

(As it turns out, the hybrid OOP languages are the ones that are still around and widely used. I think there are three reasons. First, they allowed developers to leverage their existing skills without starting from scratch with a new language and a new paradigm. Second, the hybrid languages were supported by mature tools that let developers use OOP without paying a big performance penalty. Third, the compiler vendors of the day had a big investment in existing technology, so they put their support behind products they could bring to market incrementally.)

As the editor of one of the industry's leading journals, I felt I needed to explore OOP more thoroughly by learning to use an OOP language. I opted for Smalltalk.

Born at Xerox PARC, Smalltalk was the prestige OOP language in those days. It was 100 percent pure OOP and it was supported by elegant, mature, browser-based environments. It worked great in GUI environments. Yes, it was a bit of a resource hog, and yes, performance was a problem...but for learning OOP principles, Smalltalk was the right choice. I started with Digitalk's Smalltalk/V for Windows and eventually got a copy of ParcPlace's VisualWorks.

Looking back on it, I can't help but be struck by the similarities between Smalltalk and Java. They both rely on virtual machines that let them run on any supported platform with no code changes. They both support OOP with single inheritance. There are even similarities in the development environments.

I conducted an Internet search for Digitalk and ParcPlace the other day, and was saddened when HotBot came up empty. These companies -- pioneers of the OOP world -- slipped away while I wasn't watching. VisualWorks, which came to encompass Smalltalk/V after ParcPlace and Digital merged, is now sold by Cincom. The leading Smalltalk currently on the market seems to be IBM's VisualAge Smalltalk.

Back to the future with Squeak

I was reminded of the early days of OOP when I happened to blunder into the online home of the Squeak project. Squeak is a new, open implementation of Smalltalk written by Smalltalk authors Dan Ingalls and Alan Kay. They did the work while they were at Apple (they are now at Disney); Squeak code and binaries are available under a liberal license.

Squeak is written in Smalltalk, which means it is easy to extend and modify the environment. (For efficiency's sake, Squeak emits C code so you can create a fully compiled version of your app once it's complete.) It runs on a huge selection of operating systems.

I haven't touched Smalltalk in a decade, but I am sorely tempted by Squeak. It's open, it's available for Linux and Windows, it's free of the controversy surrounding Java...and coolest of all, it's Smalltalk. I guess it's true: Old programmers never fade away, they just misplace their pointers...or however that old joke goes.

Keep hacking!

An award-winning writer and editor, J.D. Hildebrand is the content director and editor-in-chief of Inprise's developer community.


Server Response from: ETNASC02