I've been dealing quite a lot with the Drupal API, and thought to finally open my mouth about something that has bugged me ever since the start.

Why aren't there example code snippets and a comment possibility, similar to what php.net has? I don't know about you, but programming gets a LOT easier when you can start modifying existing code instead of looking carefully at the existing documentation and trying to create something from scratch. I really don't see any downsides in this, either. When coding PHP, the examples and comments give me at least as much information as the API part itself.

What do you think? In my opinion this would make module development significantly easier and with time it'd probably lead to Drupal being even more popular.

Comments

vm’s picture

in case you've not seen it, api.drupal.org may help.

marcvangend’s picture

I guess convulsion is already referring to api.drupal.org... There are some example modules in the api documentation, see http://api.drupal.org/api/search/6/example.module. But I do think that the possibility to post example snippets like on php.net would be a nice addition. If you want to bring this to the attention of the maintainers of the site, it's best to create an issue in the issue tracker under the project 'drupal.org infrastructure'.