09
Jan
08

The style guide I am currently reviewing for HaKT Studios…

well here is the Style guide I have personally recommended for php scripts when writing for Beta_

Hakt Studios PHP Style Guide --

Variables should be in camelMethod

Variables should be no more then 15 characters long.

tabs should be measured as every 4 spaces starting from column 0

any given line should be no more then 80 characters long.

braces should always be on their own lines i.e.

function Name()
{
  command 1;
  command 2;
  function name()
  {
    command 3;
    command 4
  }
}

section comments should be as follows

///////////////////////////////////////////////////////////////////////////////
// line 1 of comments
// line 2

line comments should be as follows

command; // comment

variables should be defined as near to the top of the script as possible and
should be commented with line comments telling us what they are for

if line comments need multiple lines they should be as follows

command1; // comment line 1
          // comment line 2

comments should start one tab after the command, if this is not possible, they
should be indented an additional tab just before the line they are commenting
and there should be an empty line just before the comment as follows

command1;

  // comment for the next command
command2;

if we all agree to follow this simple syntax in our php project files, our code
will be much more readable, making all our lives easier.

course, this is only a rough draft and is still open for critisizm by the other developers. By no means official. I figure we should have one though to make the project easier to maintain.


0 Responses to “The style guide I am currently reviewing for HaKT Studios…”



  1. No Comments Yet

Leave a Reply