Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.
« Sometimes Plain Text is Best
Hazards of primarily using a cell phone »

API Design

May 5th, 2004

I ran across a couple older items on API design: Words of Wisdom on Designing Usable APIs and Think of Objects as Machines.

good API designs happens when designers think of … client programmers as users.

I wish more developers took this to heart. I’ll add my own law of API design:

Good API design makes common things simple while leaving uncommon things possible.

You can call it Moore’s law. :)

When comparing two API possibilities, I often just count characters in a couple common examples of usage. To me, the API choice that results in fewer characters for the client programmer is usually the better API. This can tip the balance for subtle choices, or help evaluate two libraries which do the same thing.

categories Software Design
tags api-design

Related Posts

  • Design Eye for the Usability Guy
  • php | tek Wrapup
  • Michigan Taxes Graphic Design Services
  • The rumors of PEAR’s demise are greatly exaggerated
  • PDO Design Evolution
You can leave a response, or trackback from your own site.

6 Responses to “API Design”

  1. #1 Marcus Baker responds...
    May 10th, 2004 at 6:22 am

    Hi.

    As an experiment the early versions of the SimpleTest API used TDD - Tutorial Driven Design. I wanted to write a mock object article and so wanted to add mocks to PHPUnit. I was working out the interface through the article. The problems I encountered caused me to write my own test case class and shelve the article for nearly a year.

    Recently the API has been driven more by user requests, theft from the Java world (JWebUnit) and domain concepts (the web browser), but I am thinking that more than anything I should write another tutorial.

    yours, Marcus

  2. #2 Harry Fuecks responds...
    May 10th, 2004 at 4:11 pm

    Tutorial Driven Design - you may be onto something. Seriously. Course it’s going to be hard for managers to swallow: “All coding begins… with a tutorial”

  3. #3 Jeff Moore responds...
    May 12th, 2004 at 6:51 pm

    Maybe thats why I like SimpleTest so much. Designing the application by writing user documentation is not a new idea. I think that taking a tutorial oriented approach is a great idea because it focuses on the tasks that a user would want to do. User documentation that simply enumerated screens and menu items or that simply enumerated classes would not be good candidates for driving development. They are too much like the big design up front that the agile methodologies are trying to avoid. Writing tutorials doesn’t sound much different than writing stories. (use cases, essential use cases, scenarios or whatever you want to call them, I have a fondness for task based UI design.)

  4. Jeff Moore’s Blog » Exceptional PHP pingbacked on May 24th, 2004 at 9:38 pm
  5. #5 Mel Pullen responds...
    October 11th, 2004 at 12:39 am

    design by documentation is not new. The Sperry Univac 1100 mainframe operating system was not written until the reference manual had been written and approved.
    It’s still a great idea. Anyone want to collaborate on a book?

  6. #6 Katie responds...
    November 6th, 2006 at 12:51 am

    Looking+for+information+

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

code: use [code=php][/code].

Comment Preview

  • Search

  • Subscribe

    Subscribe All Posts
    Subscribe All Comments
    Subscribe All Bookmarks
    Subscribe with Bloglines Subscribe with My Yahoo Add to netvibes Subscribe in NewsGator Online Add to Google
  • Share This

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (16)
    • Open Source (14)
    • PHP (95)
    • Software Design (28)
    • Usability (14)
    • WACT (7)
    • Web Design (20)
  • Recent Comments

    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  94
      noujoum, Michiel Van Kets, isorabins [...]
    • Sarah Snow Stever  24
      Dubai Web Design, Development, Snowcore, ennah [...]
    • Benchmarking PHP's Magic Methods  8
      stas, minikperi, Shelon Padmore [...]
    • Keywords and Language Simplicity  7
      olmse, Handy, minikperi [...]
    • Even the Big Guys Get Validation Wrong  4
      James Benson, Michael, Enric Naval [...]
    • Improved Error Messages in PHP 5  12
      James Benson, Iron, baggreeddog [...]
    • How to Transfer Mac OS X Application Data between Computers  36
      Secret Santa, micala, Khaled bin Alwaleed [...]
    • Programming Language Trends via Google  15
      MattW, Jeff Davis, retry [...]
    • PHP Development From Java Architects Eye  10
      Grrkkvho, Bobrila, FelhoBacsi [...]
    • The value of MVC  9
      Euvmetkk, Bobrila, Vulchak [...]
    • nofollow and comment spam  5
      Scopmazo, Qmumqckx, sss [...]
  • Pages

    • Tags
  • Recent Posts

    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)
    • Keywords and Language Simplicity
    • Improved Error Messages in PHP 5
    • Michigan Taxes Graphic Design Services
    • Ruby versus PHP or There and Back Again
  • Archives

    • 2008: May
    • 2007: Jan Feb Mar Apr May Sep Oct Nov
    • 2006: Jan Feb Mar Apr May Jun Jul Oct Nov Dec
    • 2005: Jan Feb Mar Apr May Sep Oct Nov Dec
    • 2004: Apr May Jun Jul Aug Sep Oct Nov
  • Menu

    • Register
    • Log in