Skip to content

Developer Practices

saich edited this page Mar 5, 2011 · 1 revision
  • A common bad practice among beginners: Uploading a large image to the server (like, 1024 * 768) & then set required image & height(200 * 150) in HTML. This would cause unnecessary bandwidth waste which can be easily avoided by uploading the resized image of the desired dimensions.

  • Always use XHTML tags. meaning that, your HTML should be well-formed XML (closing & ending tags should be present). Like, for example, use
    instead of

  • There should not be any direct reference to the host name anywhere in the links / css / forms. You can use '/' or

  • For PHP Code, avoid using the PHP Shorthand code (i.e.; <?). Use <?php completely.

  • In any form, if a field has a label, it must be surrounded in tag. It should not be a direct text. For usage example, look into www/application/views/user/register.php.

  • Proper & descriptive commit message to every check-in. Please follow the template mentioned at in http://gitref.org/basic/#commit/. Also, add [code] / [content] tags to to the commit message. Also, give reference to the bug-id it deals with.

  • Use Kohana::log() at all appropriate places (especially, when something fails, like a database request etc.). Log files are good way to understand what's going wrong on the site.

  • Never make any changes in core files (system/ & modules/). It makes upgradation tough & is not a good practice. Moreover, Kohana provides good ways to override default behavior.

  • In Controller's function names, use only lowercase characters. Use complete words separated by underscore, instead of using abbreviations. (e.g: Use donation_book instead of donBook). URL plays big part in SEO calculation.

  • Always use lowercase filenames for images / css / scripts.

Clone this wiki locally