Last updated February 22, 2012. Created by mr.baileys on August 23, 2008.
Edited by vigneshbabu, Senpai. Log in to edit this page.

If entire function's source code doesn't fit screen of your editor, it's probably trying to do too many tasks and should be broken down into small functions.

  • On the other hand, If entire source code of the function fits within the screen size,then it's more likely that everyone will be able to comprehend what that function is trying to achieve (and will be able to debug errors easily).
  • Note: Smaller functions doing single task is easier to test and reusable

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.