Using the Examples project to learn to use Drupal's API

Benjamin Melançon's picture
Submitted by Benjamin Melançon on 2010, August 4 - 21:22
  • http://drupal.org/project/examples

    Heather James sings the project's praises:

    Drupal's API documentation is great, but it's also good to see a hook in use. It's like learning grammar from a dictionary. You can find the definition of the word, whether it's a verb or a noun and even the tenses; but you can't get the context. This is where it's helpful to see it used in a sentence. Learning Drupal development from the API documentation would be a bit like that. You want to see how the code is used. But sometimes it can be hard to find the right example.

    Lecturers who teach programming aim to find the balance between examples that are so simplified as to be useless: (see: hello world) and examples that are so complex that a novice can't identify a pattern and modify it for their needs.

    The alternative is a minimal example:

    " A minimal example is focused on a single feature or programming concept. It is a complete executable program, crafted to be as short as possible. It is instrumented for observability with no attempt to do anything other than to illustrate a point." from Hoffman & Walsh, Teaching Programming With Minimal Examples.

  • Explanation

  • http://acquia.com/blog/heather/learn-examples-module
  • Book element

  • Concept