Collaboration
Collaborating is a powerful and useful tool. It is the way us developers learn from each other especially as we usually work with other developers who have different specialist skills to our own. To make collaboration less daunting we use tools like SVN subversion which is a version control system, allowing multiple developers to work on the same files. Also to aid our development it is good practice to use a standard coding style and technique.
My Specialities
- (x)html
- css (cross-browser, cross-system, cross-version)
- JavaScript, AJAX, DHTML - (jQuery)
- W3C (Strict) Compliant
- PHP (OOP)
- MySQL
- XML, RSS feeds
- Zend FrameWork
- SVN SubVersion, CVS
- Linux - Bash/Shell
- LAMP & WAMP Stack
- Apache
- Agile Development
Reasons to get in touch
- Would you like to work with other like-minded people?
- Do you want to learn from other experienced developers?
- Do you want to share your knowledge and experience with others?
- Rapidly excel your development skills by collaborating with other developers around the world.
- Fill out your CV and become more employable.
- Work on larger projects and get that vital experience.
Get involved
Coding Standards
To assist in collaboration, it is good practice to work to a coding standards. Below are the coding standards I have picked up along the way from various developers and I have found the following to be most efficient and widely used.
(x)html
- Code to a standard! W3C transistional or strict. Strict is preferred. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
- Comment end DIVs. When these are nested it can be extremely difficult to manage. <div id="page"> ... </div> <div id="page"> ... </div><!-- page closing div -->
- Do NOT use TABLEs tags for layout. Tables are designed for tabular data only. Use DIVs for layout and float accordingly.
- Do NOT use CSS style sheet hacks for cross-browser compatibility. Use separate style sheets for each browser. Html conditional statements are suitable for 99% of situations. /* CSS */ body { width:700px; } body* { width:697px; } <!-- html: css conditional statements --> <!--[if IE]> <link rel='stylesheet' href='css/style_ie.php' type='text/css' media='screen' /> <![endif]--> <!--[if lte IE 6]> <link rel='stylesheet' href='css/style_ie6.php' type='text/css' media='screen' /> <![endif]--> If you need to be OS (operating system) and Browser version specific use a server-side sniffer to accomplish this. Do NOT use client-side browser detection (if javascript is disabled this will not work!).
CSS
- Use the complete path in your CSS when refering to html tags div { color:#fff; } div#page div.box div { color:#fff; }
- Always end/close the CSS property even if it is the last or only one on the line. div { width:10em } div { width:10em; }
- Use EMs (em) sizes not PXs (px). This way the page will not break when scaled up and down for different users. div { width:700px; } div { width:70em; } 1em can equal 10px by using the following code at the top of your CSS style sheets html {font-size:1.25em;} body {font:50%; }
jQuery
- Use jQuery functions not javascript ... function js() { } ... $jQueryFunction.fn = function() { ... }
PHP
- When commenting your code use # for a main section and // for individual lines. Line the // comments up for each section if possible // add all items in the basket $a = $b + $c; # first item $d = $e + $f; // second item # add all items in the basket $a = $b + $c; // first item $d = $e + $f; // second item
- Always comment your code. Dont explain what you are doing, explain why you are doing it. # $a is equal to $b plus $c $a = $b + $c; # $b is the total exc VAT, $c is VAT only. $a is the total amount the user will have to pay (inc VAT). $a = $b + $c;
- Use full PHP tags - will work on any server <? <?php
- Do NOT use ternary conditions - easier for the next developer $x == $y ? $a : $b if ($x == $y) { $x = $a; } else { $x = $b; }
- Name folders/files/classes/methods/functions/variables with a descriptive name $user->name(4) $user->getNameById(4)
- Camel case code $thisismyname $thisIsMyName
MySQL
- Always capitalise MySQL commands select * from table SELECT * FROM table
- Do NOT put all queries on one line SELECT * FROM table WHERE column1 = 1 AND column2 = 2 ORDER BY column1 DESC LIMIT 0,5 SELECT * FROM table WHERE column1 = 1 AND column2 = 2 ORDER BY column1 DESC LIMIT BY 0,5
- Do NOT use MySQL commands/reserved words for database/table/column names! date created_on or updated_on
Directory strucutre
- admin ... notes, documentation etc application data ... database dumps, database schemas library ... framework library, custom library, opensource library etc public ... publicly accessible files resources ... supplied content, downloaded zipped files etc test ... unit testing scripts, higher level test scripts
SVN Subversion
- Directory structure ... trunk, branch, release Use your own user ... initial & surname (i.e. ejaoude) Alway put a comment when commiting to the repository ... with as much detail as possible. If in doubt put it in! Never commit broken or uncomplete code to the truck ... if neccessary create a branch and merge back when ready or complete