Coding Style

Coding Style

PHP Code mIRC Code C++ Java Visual Basic Code

Braceing Style

One true bracing standard with three space indententation.

function example($a,$b,$c="defult") {
   if ( $a != $b ) { return 1; }
   else {
      print ($c);
      return 0;
   }
}
;Notice I define all my key alias's in remote files.
;I let mIRC take care of my indentation.
alias example {
   if ( $1 != $2 ) { return 1 }
   else {
      echo -a $iif($3 == $null,defult,$3)
      return 0
   }
}
bool example(int a, int b, char *c);
/* Main Program Here */
bool example(int a, int b, char *c) {
   if ( a != b ) { return 1; }
   else {
      if ( c[0] == null ) cout << "default";
      else cout << c;
      return 0;
   }
}
class ExampleFunctions {
   static boolean example(int a, int b, String c) {
      if ( a != b ) { return 1; }
      else {
         if ( c == null ) System.out.println("default");
         else System.out.println(c);
         return 0;
      }
   }
}
public function example(a as Integer, b as Integer, c as String) as boolean
   if ( a <> b ) then
      example = true
   else
      if ( c = vbNull ) then c = "defult"
      print c
      example = false
   end if
end function

Multi-Line String Literals

print(
        'line one' .
        'more text' .
        'another line' .
     );
System.out.println(
                     "line one" +
                     "more text" +
                     "another line" +
                  );

Included HTML

Extra PHP Blocks are used for clairty.

<?
/* Some PHP Code Here */
?>
<? if ( $showLoginForm ) { ?>
<!--Login Form Code Here-->
<? } ?>
<?
/* More PHP Code Here */
?>

Leave a Reply