Show Me the Pattern

Dr. Dobb's Journal June 1998

By Michael Swaine

Michael is editor-at-large for DDJ. He can be contacted at mswaine@swaine.com.

On February 23, Intel breaks tradition and agrees to produce a microprocessor it didn't design. Intel will make the StrongARM chip, designed by ARM and used in handheld computers like the Apple Newton MessagePad, under license to ARM.

On February 26, 3Com announced a new version of the PalmPilot, the only currently profitable handheld computer. The Palm III has a new design, new features, two MB of RAM.

On February 27, Apple announced a halt in all development on its Newton line.

No doubt there's a pattern here, but if there is, I don't know what it is.

A Little Java, A Few Patterns

While in Bloomington, Indiana recently, I stopped by the campus bookstore and bought a copy of Matthias Felleisen and Daniel P. Friedman's A Little Java, A Few Patterns (MIT Press, 1998, ISBN 0-262-56115-8).

I try to keep up with Dan Friedman's books. I was his graduate assistant many years ago, and had a kind of epiphany back then when I read his entertaining and insight-generating book The Little Lisper (Scientific Research Associates, 1974, ISBN 0-574-19165-8). It taught me to think in Lisp. I readily admit that this is a skill not in high demand today, but I think of it like the Latin I learned in high school -- it helps me to understand other languages.

This new Java book, like the old Lisp book, uses a rigid question-and-answer approach that you would think would be artificial and possibly annoying. But Friedman put it to brilliant use in the Lisp book. I was curious to see how it worked for Java, and what Felleisen and Friedman had to say about design patterns.

I should have known better.

If you don't know anything about design patterns, you will be better equipped to read books on the subject after reading A Little Java, A Few Patterns. You will have a feel for Java interfaces, the Visitor pattern, and the Interpreter, Composite, Template Method, and Factory Method patterns. But you won't be aware of having learned a darned thing about design patterns, since object-oriented programming and design patterns are never explicitly mentioned in the body of the book, except in cryptic footnotes.

Similarly, if you don't know Java, you will be much more familiar with the language after reading this book, but you won't have seen a formal or informal specification of the language, or even of the subset of the language that Felleisen and Friedman use. Any knowledge of Java conveyed by this book will be subliminal or osmotic.

Furthermore, you will learn how to work in the functional programming paradigm that Friedman prefers, and see how it complements the object-oriented paradigm, but without a word of explanation of what functional programming is.

In short, if you work through the book, you'll end up knowing a lot that you didn't know, but you won't know what it is that you now know. That's because Felleisen and Friedman teach programming like aerobics. They leave out all the rules and definitions, and have you learn by sweating through short exercises.

Their method is called, or used to be called anyway, programmed learning, and I suspect it's long been out of favor as a pedagogical tool. It's tricky, it can be pretty hokey, and if it isn't done well it can be an awfully roundabout way of putting across complex concepts. But Felleisen and Friedman use it masterfully, taking care with the order in which subjects are developed, using redundancy and humor to good effect, even playing with the format for humorous effect. Here the answer starts asking the questions and cops an attitude:

Q:Here is the interface for PiemanM...

A:Isn't it missing p?

Q:We don't specify fields in interfaces. And in any case, we don't want anybody else to see p.

A:Whatever.

Whatever; it works. I found the book charming and instructive, a worthy companion to the authors' The Little Lisper, The Little Schemer, and The Little MLer. If you're trying to get the "feel" of design patterns, Java, or functional programming, you would do well to read A Little Java, A Few Patterns.

It's Taps for Newton

While at the bookstore, I also got a good deal on some accouterments for my Newton MessagePad (or "Little Scribbly Thing," as Steve Jobs calls it). A very good deal. You can usually get some real bargains on software and equipment if you wait until the hardware platform has been discontinued.

And discontinued the Newton platform is.

But I won't miss my two MessagePads, because I have no intention of giving them up. I'll continue to use the MP100 to track the status of the irrigation system and for similar odd jobs on our herb farm (my partner's business). I've written simple data-collection apps for it and will write more, and I'll tote the thing around the farm, collecting data and making notes. Farming, as it happens, was one of the first areas in which Newtons were put to real use.

And I'll continue to use the MP130 with its nice backlighting and its amazing battery life to take notes. The handwriting recognition is good enough for my purposes, and anyway, I mainly use Ink Text mode, capturing the stylus strokes in real time and interpreting them later if needed. Often, that's not needed.

And I'll continue to download shareware or freeware that other Newton users will continue to develop. It's only Apple that's abandoned Newton.

That's enough, of course. They won't be building any more, and the system software won't be upgraded. This is, despite us die-hards, essentially the end of Newton.

The beginning of Newton goes back as far as early 1987, when Steve Sakoman floated an idea to Jean-Louis Gassée for something Newtonian. Gassée helped him investigate some possibilities for producing the device outside Apple, including setting up a meeting with Lotus founder Mitch Kapor. But ultimately they decided to pursue the concept within Apple, and the Newton effort was launched as a polecatworks project. When Gassée left three years later to start Be, he took Sakoman with him as VP of Engineering, a position he still holds. Meanwhile at Apple, new blood came in to keep the Newton altar red, although that may not be how they thought of it at the time.

The Newton was finally announced at MacWorld Expo with much hoopla and a pronouncement by John Sculley that the market for such devices could be a trillion dollars by the year 2000.

People lined up in droves at the show to buy the thing. It did look cool.

Then the jokes started.

Having Gary Trudeau make fun of you in the funny papers is classic bad press. Apple weathered the jokes about the handwriting recognition and worked to improve it, but there were other, worse problems with the Newton at the time of its launch.

Six Reasons Why Newton Failed

On our Dr. Dobb's TechNetcast (http:// www.technetcast.com/), Gassée recently identified four problems with the original Newton:

I'd agree with all of Gassée's points and add two:

But the one deadly error at the launch was the positioning error. The early adopter to whom it should have been targeted would (and did) put up with the bad handwriting recognition, the connectivity problems, and the awkward size, and they'd always pay the premium to be on the cutting edge. The general market wouldn't.

Of course, early adopters and technophiles are a small market. Opening up to the broader markets was going to require licensing, and my guess is that promising licensing deals were lost because of the early bad press.

A lot of dreams got snuffed in those lost license deals. Gassée, aware that the MacOS was getting long in the tooth and seeing that the Taligent project was going nowhere, even imagined a desktop Newton. But Apple had to pour money into the Newton to keep it afloat in the beginning. The 80,000 sold the first year was a long way from that trillion dollar market.

Fixing Newton

Apple did keep supporting it, and was quick to understand that the market was defining Newton as a device not for the businessperson's briefcase but for the doctor's pocket or the farmer's toolkit. Its market was a collection of vertical markets. Specialized vertical market software began to emerge. Farming, medicine, retail. Some nice stuff. Apple released the MessagePad 110 and then the 120 and the 130 with backlighting. The power draw of the ARM processor is so low that my 130 has several times the battery life of my portable.

Apple fixed the handwriting recognition, first by licensing Graffiti, which though not transparent is good enough to make PalmPilot a runaway success and win it two thirds of the handheld market, and then later with its own better recognition engine.

(You might say that handwriting recognition is still not ready for prime time, but it appears that a lot of people are willing to put up with a certain level of inconvenience for it. The level of inconvenience is defined by the performance of Graffiti on the PalmPilot.)

When Apple introduced the MessagePad 2000, it upped the ante more than is common in this industry. The StrongARM chip in the 2000 gave it about ten times the processing power of the 130. The 2000 and the 2100 were impressive products. The trouble was, Apple wasn't supposed to be creating all the Newton products.

As I understand it, the MessagePad was only intended to demonstrate the technology. Other form factors would soon follow: Newton phones, Newton tablets, Newton whiteboards, all built by other companies who licensed the Newton technology. But the licenses didn't happen, so Apple released the eMate 300. This cute device caught on big in the education market, but not enough to pull Apple's Newton efforts out of the red.

The End

So even as the company was announcing the 2000 and the eMate, Gil Amelio was looking for a buyer for the Newton division.

By the beginning of last year, PalmPilot had 66 percent of the handheld market, Windows CE had 20 percent, and Apple's Newton OS had six percent, according to Dataquest. Compared to its current three percent share of the desktop market, six percent might sound good, but the handheld market wasn't quite on track for that trillion dollar value. And even though Apple has only about three percent of the desktop market, it is consistently one of the top three sellers. As a computer manufacturer, Apple is one of the leaders. In the handheld market, it was a distant third.

In July of last year, Amelio spun off the Newton division as a separate subsidiary in preparation for selling it. Then surprisingly, a few months later Steve Jobs rescinded that decision.

Was it, as the hopeful told themselves at the time, evidence that Steve was considering keeping the Newton alive and within Apple? Subsequent events say not hardly.

My reading of the tea leaves says that Steve wanted to keep the people and technology, and scrap the platform and operating system. More than a year ago, he made it clear that he didn't think Apple should try to support three operating systems, and he also made it clear that he didn't think that much of the "little scribbly thing." Pulling the Newton division back into Apple made it easier to move people (and their expertise in certain features that made the Newton special) into other departments while shutting down Newton. That's just what has happened. So I think it's clear that Steve never changed his mind about killing off Newton. Why he wanted to do this is another question. Conspiracy buffs and other pattern-seekers can theorize that killing off Newton, Sculley's pet project, was Steve's revenge on the man who forced him out of Apple. The irony is there, and I'm sure that Steve (and John) appreciate it. But I don't think that was the reason.

Or you can latch onto the timing of the announcement: It was clear that Newton was dead in the water months before the official announcement. Why the delay? To squeeze a few more bucks out of poor schoolkids who didn't know that eMate was a doomed product?

But the parsimonious answer is that Steve just did what was best for Apple.

If I pull my Apple Booster hat out of mothballs and put it on, I can even see that killing off Newton was a smart move. (The stock market thought so, bumping Apple's stock price up on the news.) Supporting three operating systems? Hanging onto technology that continues to bleed red ink? Staying in a market where you're running a distant third? Hardly smart if you're trying to keep an ailing company on its feet. And that's exactly what Steve Jobs is trying to do. I can lament his decision, but I can't challenge its wisdom.

And the eMate orphans? I'll pass up the cheap child-support joke and just say that Steve promised that there would be a MacOS-based replacement for the eMate in 1999. No doubt some of the Newton people reassigned to other divisions of the company will play a part in creating it.

Answers to Trivia Quiz

Those of you who don't read the April issue until April may object to my giving out, in a column that I'm writing in March, the answers to a quiz that ran in the April issue, thus depriving you (all but those who read the April issue in early March) of a chance to respond. But you have no complaint; I originally ran this quiz last December, and you didn't respond then.

Well, hardly anyone did.

When I republished the quiz in April I got many responses, but no perfect ones. If I get any really, really good responses after I submit this column (but before it is published), I will acknowledge them in the July or August issue. But here, for the last time, is the puzzle; and for the first and last time, are the answers.

1. Working with another computer enthusiast, this man created an enormously popular personal computer. In 1977, when it was first released, most microcomputers were boxed in metal (or occasionally wood), but his stylish machine wore a custom-molded plastic case. It used a slow audio cassette recorder for storage and displayed only uppercase letters, but you could program it in Basic and people loved it. It sold for $399. His first name is Steve; what is his last name?

Answer: Most of those details apply to the Apple 1 or II, suggesting that the last name might be Wozniak, but the price doesn't work. The correct answer is Leininger. Steve Leininger and Don French created the Radio Shack TRS-80 Model 1, my first personal computer. Congratulations to Walt Polley for being the second to get this one right. Eugene Kim was the first, as he was with several other questions, but since he's a DDJ editor, he only gets acknowledged once. Rules are rules, even if I make them up as I go.

2. What's (4195835/3145727)*(3145727)? Two answers required. That's two distinct answers, not the same answer in two different forms.

Answer: 4195835 and 4195579. That's my preferred response. The first number is correct, and the second is what you get if you have a Pentium with that infamous math bug. It's also perfectly correct to give 3145727 as the second answer, because it's what you'd get doing integer math. I'm giving credit here to Matthew Hayward and Michael Tsai.

3. This executive of a Palo Alto software design firm used to drive around the Valley in a Japanese car with the vanity California license plate PRERUDE. Name the executive. Two answers required, but here's a hint: One of the answers is what a winery might do if it got bad barrels.

Answer: Sue Cooper, CEO of Cooper Interaction Design. A cooper is a barrel maker. The second answer is Sue's husband, Alan Cooper, the company's president. Only Jerry Eagle got Alan Cooper by the arbitrary deadline. Alan is one of the most popular and controversial speakers on software design, but few people know him, apparently, by his license number.

For reasons that surpass my understanding, four correspondents submitted "Sue Cooper" as their answer not just to this but to other questions as well, including the one about Steve Wozniak's secret identity. When I forwarded their responses to Sue, she e-mailed back a quote from Lily Tomlin: "I always wanted to be somebody, but I see now that I should have been more specific."

4. Who was Mr. Snoid, and what was his contribution to personal computer history?

Answer: According to DDJ readers, Mr. Snoid is/was a member of the rock group Subhumans, one of the droids in Mark Crispin's 1978 spoof Software Wars, a student in Texas, the claymation mascot of Domino's Pizza in the '80s, a character in Charles Dickens' A Christmas Carol, the first nerd as drawn by Dr. Seuss, a Windows telnet hacker, an R. Crumb cartoon character from the '60s, and Jeff Duntemann's dog. That may all be true, but what I had in mind was this: Anyone with a copy of my history of the personal computer, Fire in the Valley, can find Mr. Snoid's name on page 168 in a photo credit. That's his contribution. I know, brutal. He's not listed in the index, and the book's out of print. Blame the aforementioned Alan Cooper, the subject of the photo, for that attribution, by the way. I'll award the horseshoe prize (for coming closest) to Dan Allison.

5. Silicon Valley legend Steve Wozniak is the very soul of honesty and decency, so it may be startling to learn of his shady past defrauding the phone company and defaming ethnic minorities. But this question isn't about Steve's blue box adventures or his dial-a-joke service. It's about his other identity. Steve lived for some time under an assumed name. Why did he do this, and what was the name?

Answer: To keep a low profile while attending UC Berkeley to get that degree he didn't get around to before becoming a software and hardware legend, he enrolled as Rocky Clark. Robert H. Schmidt got it first.

6. What's another name for "Tradewind"? Two answers required.

Answer: No ex-Lotus employees out there? The answer is Metro or Casino, depending on whether you are talking about a Lotus product or the code name of a Lotus product. On page 428 of Michael Hyman's excellent PC Roadkill (IDG Books, 1995, ISBN 1-56884-348-8), we read "Metro [was] code-named Tradewind while Tradewind [was] simultaneously code-named Casino." Nobody got this one.

7. In what city does Clarus the Dogcow live? Two answers required.

Answer: Clarus was originally a character in the Cairo font, designed by Susan Kare. That's one city. You can't consider yourself a Mac programmer, if that matters to you, unless you know all about this stuff, and there's a lot of Clarus stuff to know, including the mysterious Tech Note 31 and why Matthew Hayward said he couldn't answer the question because Mark Harlan wouldn't return his phone calls. A good introductory course in Clarus knowledge can be found in Owen Linzmayer's Mac Bathroom Reader (Sybex, 1994, ISBN 0-7821-1531-4). Unless cut in a new round of layoffs since I turned this column in, Clarus can also still be seen, big as life(?), standing outside Apple's corporate offices, so Cupertino is the other city. No credit for Sim City and Sim City 2000, Aaron Harsh. Winner: Robert H. Schmidt.

8. What product is being described here? "Using CL is similar to placing your pencil on a piece of paper, and then writing something down. The main difference is that CL provides you with a 'magic' piece of paper that has the ability to do computations like a calculator." Two answers required.

Answer: This description is from the first manual for CalcuLedger (thus the CL), as reprinted in Programmers at Work, by Susan Lammers (Microsoft Press, 1986, ISBN 0-914845-71-3). CalcuLedger was later renamed VisiCalc, so the two answers are CalcuLedger and VisiCalc. Nobody got this right, but Matthew Hayward insisted that he heard Mathematica described this way, so he gets the squeaky wheel award.

9. Few people know that one of the founders of Go Corp. also wrote a controversial little program called MacJesus Pro Gold. Or did he. Name this moonlighting entrepreneur. One answer, but two people. Explain what I'm talking about.

Answer: Robert Carr and Robert Carr. Two different guys with the same name. Partial credit to Julian Bunn for getting the answer first, full credit to Robert H. Schmidt for explaining it.

10. Who created paparazzi?

Answer: Federico Fellini. The word paparazzi, singular paparazzo, comes from a photographer of that name in the film "La Dolce Vita." Walt Polley gets the award here. I hope the fame doesn't get him mobbed by paparazzi.

DDJ


Copyright © 1998, Dr. Dobb's Journal