Don’t Put Reset Buttons in Your API

January 7, 2009

A corollary to Don’t Put Reset Buttons on Forms

Reset buttons save time in a tiny minority of cases. Actually, I can’t think of any good uses for reset buttons, but I’m sure they’re out there. I’m sure there’s some person out there who looks good in white pants, but I’ve never seen one. Maybe in Australia. Yet people who really ought to know better persist in wearing white pants and people who really ought to know better still put reset buttons on forms.

API designers, take heed. Insofar as an API makes some end-product designs easy and other designs hard, it should make good designs easy and bad designs hard.

The “API” of HTML makes reset buttons as easy as Submit buttons. Reset buttons are usually bad design. Trouble lurks.

The Wandering Programmer wants to make a volunteer application form for his super-awesome conference in Vancouver. He comes across an HTML forms tutorial and sees code for a reset button. It’s easy. The Wandering Programmer puts a reset button in his form. Why not?

On the eve of the application deadline, The Dawdling Student painstakingly fills out a well-crafted application, full of witty turns of phrase and intriguing commentary on the scintillating world of academic conferences. The seconds hum along to the deadline, but the Student broods over each word before finally! It is time for submission. By now it is near midnight and the Student’s hourly double-espresso is beginning to wear off and in a twitch the RESET button is struck, just millimeters away from the goal, and all is lost.

A long time ago, many programmers worked late nights to bring their boring crufty Desktop Applications to the Web. Most of the Web copies were worse than the Desktop versions, just as you might expect. But some of the Applications were easier to use!

In the world of Desktop Applications, platform makers like Microsoft and Apple created wonderfully rich, powerful and complicated widgets programmers could use in their software. They made it easy. And Programmers used them, often when they shouldn’t. Then, the Horde of Hapless Users came along and were confused.

When the move to the web happened, the Programmers found it difficult to copy their complicated widgets. They were forced to express their programs in simple controls. When the Horde of Hapless Users came to the Web applications, they were not confused any more. The simple Web programs were better than the complicated ones they replaced.

Programmers will go with the grain of an API. The API of desktop application makers make it as easy to use complicated widgets as it is to use simple widgets, so programmers sometimes use complicated widgets when a simple one would be better. The grain of HTML makes it easy to stick a Reset button on your form.

An API designer should always think about the grain of the API.

Advertisements
%d bloggers like this: