From the monthly archives:

August 2009

In reading the classic essay How To Ask Questions The Smart Way, I found proof that, no matter how kind and gentle, now matter how considerate and polite we want to be, no matter how much we want to nurture participation and camaraderie, there really are stupid questions.


How To Ask Questions The Smart Way

{ 0 comments }

This paper gives a crystal-clear description of Extreme Programming (XP). I found it especially interesting in that it describes how to use Squeak in an XP environment.

Embracing Change with Squeak: Extreme Programming (XP)

{ 0 comments }

How I Plan to Learn Smalltalk

by doug on August 16, 2009

in Smalltalk

My favorite way to learn a new programming language is to build a project with the new language. I learn best when I’m having fun, and I test my new languages by building a simple database-backed e-card web site.

E-card sites are old hat, but they cover a lot of territory: you learn to read directories, manipulate images, create HTML, process forms, store information in a database, and send e-mail. I like this project so much that I use it in my PHP and Ruby classes at CCSF. Here’s the kind of site I end up with. I’m not a designer, so I get some slack on the way the site looks.

Since there are several popular Smalltalk dialects, I have to make an important decision. The problem is that I’m a newbie, so I’m going to have to guess which direction to go: commercial or open source.

I know that Cincom is a leading provider of Smalltalk solutions. The Cincom Smalltalk evangelist (James Robertson) provides a steady stream of good content, commentary, and instructional videos on cutting edge topics, such as WebVelocity and Seaside, my ultimate destination. Cincom VisualWorks is available as a free non-commercial community edition.

VisualWorks on my Hackintosh

My other choice is Squeak, an open source Smalltalk. Alan Kay, the creator of Smalltalk, is part of this project. A few years ago I worked my through Learn Programming With Robots by Stephane Ducasse. This book is designed to use Squeak to teach programming to children, and I, a rather large child, loved it. The look and feel of Squeak is rather toy-like, colorful and fun—quirky, some say. Under the surface it’s all business. The main appeal of Squeak is that I am familiar it.

However, I am leaning toward VisualWorks, but there one deterrent. I’m running a Hackintosh as my main desktop, and some VisualWorks Aqua features are not rendering correctly. The X11 version works, though it is, as you would expect, homely. I know that the real solution is to ditch the Hack and buy Genuine Apple hardware.

The Squeak interface, on the other hand, renders fine on the Hackintosh. Both VisualWorks and Squeak work perfectly on my Macbook Pro. The question is, can I live with the X11 version of VisualWorks on my work station?

Squeak on my Hackintosh

I’ll sleep on it and decide tomorrow. Will I go right brain, or left brain? I’m counting on the Collective Unconscious to help me decide.

{ 3 comments }

Why I Am Learning Smalltalk

by doug on August 15, 2009

in Smalltalk

Have I mentioned that my latest enthusiasm is Smalltalk? It’s a good fit for what I want to do with web development, and Seaside is the application platform that dots the i’s on all of the requirements on my web app wish list:

  • Easy statefullness
  • Introspection
  • Live image
  • Fast
  • No HTML
  • No templates

There are quite a few fine Smalltalk distributions, but I’m familiar with these: Cincom VisualWorks and Squeak Smalltalk. Since Squeak is free and there are many Squeak resources, including Squeak: Learn Programming with Robots, I’m dipped my toe into the water at Squeak.org. Squeak runs on OS X, Windows, and Linux, and it’s free.

Squeak is a fun way to program graphics without heartache and headache. Even a comparative lit major like me can do cool things..

The first time you work with Smalltalk, you may find yourself feeling like a stranger in a strange land. You don’t work with source files; you work with an image, which is like a living piece of code. You can change it while it’s running. Very cool stuff. Cooler than Ruby, to my mind, and I love Ruby.

When I first saw a demo of Seaside, I felt a shock of recognition: Seaside is the framework I might have built if I were smarter, more knowledgeable, and less lazy. Seaside isn’t the new kid on the web framework block. Avi Bryant and Julian Fitzell released Seaside in 2002, 2 years before DHH released Rails.

Here are a few Smalltalk resources for the intrepid adventurers among you.

Smalltalk.org
Squeak Smalltalk
Seaside Framework
WebVelocity with Seaside
Cincom VisualWorks Smalltalk
GNU Smalltalk
Croquet Consortium
OLPC Etoys

There are many free Smalltalk books available from Stephane Ducasse. Randal Schwarz, widely respected for his contributions to Perl (and the Schwarzian Transform) has become a persuasive Smalltalk advocate in his blog methodsandmessages.vox.com.

I believe that Smalltalk will gain increasing mind share in the coming years. Five years from now the general programming population will be thronging to Smalltalk courses in the local community college, as they are clamoring for PHP and Rails courses today.

{ 2 comments }

Don’t Tell The Mailman You’re Dead

by doug on August 10, 2009

in Editorial

(Reading time 2 Minutes)

Now and then I like to write letters to blowhard newspaper columnists. Here’s a thrust of my rapier dating from 1991.

6/9/91
Dear Ms. Bjorklund,

As a letter carrier for the Postal Service, I want to tell you that you gave your readers some really bad advice in your Sunday, May 26 column. I’m referring to your trick of writing “deceased” on unwanted junk mail. This trick is useless because only first, second, or fourth class mail is returned to sender. The Postal Service does’t return undeliverable junk mail; it gets dumped into postal trash bins right here in San Francisco, and whenever possible, is recycled. Thus, your message never reaches the mailers; they never find out that you are dead.

There is yet another wrinkle working against you. In the last few years most junk mail comes addressed “Ms —, or current resident.” That piece of junk mail gets delivered whether the addressee is dead or alive. And it gets delivered even after you move. Bulk mailers use this gimmick to insure saturation delivery and to avoid updating their mailing lists.

Potentially more troublesome than unwanted junk mail is what might happen when your letter marked “deceased” returns to your carrier for endorsement. What happens if he thinks that you are actually dead? In that case, his job is to hold all your mail for 10 days in case there is a legal claim on your mail by your estate or your creditors. After ten days the mail—first, second, and fourth class mail—is returned to the sender with the message that you have died. Bulk rate mail is trashed.

Over the years I have seen many people try your trick. Sometimes they write “dead,” or “moved,” or “no longer here,” or “unknown.” Most people do this to avoid paying their bills. In every case they are irate when they find that all of their mail, including mail they want, has been returned to the sender because their letter carrier believed them to be dead. They have no one to blame for their inconvenience but themselves.

In the case of your stuffed mailbox, you’ve got a righteous gripe. Your letter carrier is not supposed to cram mail into your mailbox indefinitely. If mail collects in your mailbox, your carrier is supposed to remove it and leave a notice. Reciprocally, customers are responsible for cleaning out their mailboxes.

The next time you plan to be away and don’t have any friends who will collect your mail for you, inform your local post office that you wish to have your mail held at the post office. Fill out the vacation hold form, and your mail will be held for up to 30 days. Pick up your mail when you return, and your carrier will resume delivery.

As for stopping junk mail, there’s almost nothing anyone can do. Several of my customers have tried to be deleted from every conceivable mailing list. But the junk mail keeps rolling in. Nothing can stop junk mail because it is profitable for mailers. A mere two percent positive response is sufficient to justify all those expensive catalogues. It doesn’t matter if you hate junk mail as long as two people out of a hundred like it. And believe me, many more than two percent love their Victoria’s Secret and L.L. Bean catalogs. Junk mail will flourish as long as money is made on it. Junk mail is worth billions in revenue to the Postal Service, so it’s not likely that Uncle Sam will do anything about your junk mail problem.

If you don’t want your junk mail, write “refused” on it and give it back to your carrier. My guess is that you’ll want to keep at least two percent of it.

In the meantime, don’t lie to your mailman, or anyone else you do business with. We know what kind of person you are.

Sincerely,
Douglas Putnam

{ 1 comment }

How to Become a Programmer in 40 Years

by doug on August 9, 2009

in Editorial

(Reading time 5 minutes)

The common wisdom is that our elders are wiser than we are.

My old man gave advice to anyone who would listen. His favorite piece was, “Become a CPA.” That’s what he always wanted to be. When he was 40-years old (and I was 18) he looked me dead in the eye and said, “Life has passed me by. But you’ve still got a chance to be a CPA.”

The problem was that I wanted to be a Beatnik novelist, wear a beret, and sit in coffee shops in North Beach drinking coffee with girls with long black hair. Of course, there was jazz and poetry in the background. And we would be ride about town on my Vespa motor scooter.

Ignoring the my old man’s advice, I jumped out of the Physics/Math fast track and headed down the rocky path to Comparative Literature. I figured that I was pretty good at math, so writing novels wouldn’t be much of a challenge. I would become a novelist, be rich and famous, and loaf around in coffee shops.

The problem was that I was a mediocre writer. I could write a few sentences that showed promise, but I was lazy and didn’t work at it much. I expected it to come to me easily, the way the math did. Writing fiction turned out to be more work than I anticipated. I dabbled now and then, and every rejection notice was a nail driven into my ego.

In the early 90’s I thought about changing careers, so I took up programming. I took a few courses and the local community college and I was good at it. Programming was easy for me, but I found it boring and tedious. Who in their right mind would want to write financial software for insurance companies? Not me. I wasn’t born to toil in that salt mine.

My loathing of programming inspired me to go back to fiction. I wrote a novel about my 2nd marriage. My first marriage had been a tragedy, and the 2nd had been a catastrophe that was clearly a great topic for a gritty novel. The book spilled out of me and was finished in 9 months. I felt that it was good enough to show to my friends. Big mistake.

It turns out the book had a big problem—it dealt with my stupid, carnal, hormonal side. It was about lust, sex, and bad judgment—all of the reptilian instincts were at play. I didn’t mind that the book put me in a terrible light because it was actually a work of Art. So, I took a chance and showed the book to selected friends—educated readers who could handle my Rabelasian adventures. I expected them to read the book in the spirit that they would read Henry Miller or Charles Bukowski.

Wrong again. Every reader handed manuscript back as if I had asked them to fondle a soiled pair of underwear.

“How could you write that sick shit?” said one woman.

“It all happened to me,” I said. “If Bukowski had written it, you would love it.”

“Bukowski’s an artist. Don’t you see that this is pornographic? I’m shocked,” she said.

She hasn’t talked to me since.

Several years later I sent the novel to an agent. “We don’t deal with that raw stuff. It’s not commercial,” he wrote. “You could take out some of the big words and send it to Hustler.”

I put the novel on the shelf, where it’s been ripening for the last 5 years. Now and then I take it out and read it. I enjoy it. It’s disturbing, but satisfying to read it. It’s a special book, about me, written just for my eyes. Everyone should have their own novel.

Now that my father is gone, I think about him and his advice. I would never be a CPA. Then again, I didn’t end up in North Beach, except for an occasional visit to City Lights. I don’t spend my time in coffee shops with Bohemian literati, but I go to Starbucks and Peets quite a lot. I don’t ride Vespa, either. The truth is, I’ve gone back to math and science. It’s like going back to my real home. I now take great pleasure in programming and teaching.

None of my students know, but underneath the mild-mannered software engineer lecturing about maintaining state across HTTP requests, I am a novelist…a secret novelist, who happens to be a hell of a programmer and teacher.

{ 0 comments }

Ruby On Rails: The 15 Minutes is Up

by doug on August 1, 2009

in Ruby

DHH has brilliantly coalesced the last 15 years of MVC web practices into a Perfect Storm (Rails). He dotted all the i’s and crossed all the t’s, mercifully allowing us to embalm the template-based MVC web design-strategy, put it into a glass coffin, and ship it off to the Smithsonian.

Here’s my Rails eulogy.

The first time I saw Rails—after doing Perl and PHP web development for a few years—my mind was blown: what would take me a week in Perl, or a day in PHP, could be done in 5 minutes with Rails. At the time I jokingly described Rails as crack for web developers. It’s so good, don’t even try it once!

Rails changed the way I do web development, and whenever I drop back down the evolutionary ladder to PHP, it’s like having dental surgery without anesthetics. Painful! All the repetitious tedium—building infrastructure, writing SQL, connecting to the database, the embedded language—was taken care by a the shiny Ruby black box. Rails is a web programmer’s deus ex machina.

“Don’t Repeat Yourself,” said DHH, and he lived up to his word. Rails nailed the door shut on Web 2.0.

Now that Rails has brought Web 2.0 to its end, can it do the same for Web 3.0? The answer is that Rails is no longer on the leading edge. Rails’ replacement has already dropped while you were trying to get a handle on Rails and Ruby. The new guy in town is Seaside.

Seaside arrived several years ago with little fanfare because it runs on Squeak, a relatively new version of Smalltalk. As you may know, Smalltalk is an “old” language that most of us have only heard the old-timers get sentimental about when they talk about the Good Old Days of the Computer Science Frontier.

It turns out that the Old is New again. It’s time to break camp and move on to the NeXT Level. You can get a head start on your friends (and foes) by checking out this ear-opening Floss interview with Seaside’s creator, Avi Bryant.

Hey, you don’t want to miss the Ground Floor again, do you? Give Seaside look.

{ 2 comments }