0
Becoming a PHP ninja
       Md. Emran Hasan
  emran@rightbrainsolution.com
About me
<about>

 Doing PHP for 5+ years

 Developer, consultant, manager

 CTO, Right Brain Solution Ltd.

 Previous: SW...
Introduction
This presentation is about:
– development practices

– personal development
DEVELOPMENT PRACTICES
1. Coding standards
• Readable code

• Easy to maintain

• Documentation
<?

// Method 1
if($condition)
function1($a, $b, $c);
if($i < 7 && $j > 8 || $k == 4)
a($i);

?>
<?php

// Method 2
if ($condition)
{
   getUser($id, $username, $key);
}

If (($i < 7) && (($j < 8) || ($k == 4)))
{
   di...
• PEAR Coding Standards
 http://pear.php.net/manual/en/standards.php


• Zend Framework Coding Standards
 http://framework...
2. Code Commenting
• Reduced code understanding time

• Serves as a documentation

• Answer the question: WHY??
/**
* Add number
*
* This function will take two integer numbers and will
* return the addition result of them.
*
* @param...
3. Code re-use
• Re-use code across projects

• Refactor every now & then

• Don’t Repeat Yourself (DRY)
4. Code testing
• Gives confidence

• Unit testing in rescue

• Test Driven Development (TDD)
• PHPUnit - http://www.phpunit.de
• SimpleTest - http://www.simpletest.org
5. PHP Framework
• Forces good structure

• Ready to use libraries

• Solves most real-life problems


               80% ...
•   Zend Framework - http://framework.zend.com
•   CodeIgniter - http://www.codeigniter.com
•   CakePHP - http://cakephp.o...
6. Source Control (SCM)
• Your own personal UNDO

• Compare, rollback, track source code

• Must for team collaboration
• Subversion - http://subversion.tigris.org

• Git - http://git-scm.com
7. PHP IDE
• Increased productivity

• Reduced error in code

• Debugging, profiling
• Eclipse PDT
  http://www.eclipse.org/pdt

• Netbeans IDE
  http://www.netbeans.org

• NuSphere PHPEd
  http://www.nusphe...
8. Quality Code
Your PHP code should
  – be simple

  – get the job done

  – be secure

  – be scalable

  – be maintaina...
PERSONAL DEVELOPMENT
9. Being Communicative
• Increased productivity

• Reduces confusion

• Builds synergy in team
10. Being Agile
• Working iteratively and incrementally

• Being responsible

• Being open minded
11. Updating yourself
• Trying new technology

• Reading blogs

• Get updated through RSS
• Planet PHP – http://planet-php.net

• PHPDeveloper – http://phpdeveloper.org

• Sitepoint – http://sitepoint.com

• PHP ...
12. Community involvement
• Starting to write blog

• Participate in forum and communities

• Contribute in open source pr...
Questions?
Contact

    +880 161 PHPFOUR
        @phpfour
    phpfour@gmail.com
http://www.phpfour.com/blog
Upcoming SlideShare
Loading in...5
×

Becoming A Php Ninja

5,365

Published on

A few tips on how to go to the next level in PHP web application development. Tells about SCM, code convention, code testing, DRY, etc. Targeted towards the new PHPers who have worked for around 6-12 months.

Published in: Technology
2 Comments
8 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,365
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
136
Comments
2
Likes
8
Embeds 0
No embeds

No notes for slide
  • Naming conventionFunction name – meaningfulIndentationUse of white space and new line<number>
  • <number>
  • <number>
  • <number>
  • Transcript of "Becoming A Php Ninja"

    1. 1. Becoming a PHP ninja Md. Emran Hasan emran@rightbrainsolution.com
    2. 2. About me <about> Doing PHP for 5+ years Developer, consultant, manager CTO, Right Brain Solution Ltd. Previous: SWI, Pageflakes, Trippert Labs. </about>
    3. 3. Introduction This presentation is about: – development practices – personal development
    4. 4. DEVELOPMENT PRACTICES
    5. 5. 1. Coding standards • Readable code • Easy to maintain • Documentation
    6. 6. <? // Method 1 if($condition) function1($a, $b, $c); if($i < 7 && $j > 8 || $k == 4) a($i); ?>
    7. 7. <?php // Method 2 if ($condition) { getUser($id, $username, $key); } If (($i < 7) && (($j < 8) || ($k == 4))) { displayGraph($value); }
    8. 8. • PEAR Coding Standards http://pear.php.net/manual/en/standards.php • Zend Framework Coding Standards http://framework.zend.com/manual/en/coding-standard.html • eZ Components Implementation guidelines http://www.ezcomponents.org/contributing/coding_standards
    9. 9. 2. Code Commenting • Reduced code understanding time • Serves as a documentation • Answer the question: WHY??
    10. 10. /** * Add number * * This function will take two integer numbers and will * return the addition result of them. * * @param int first number * @param int second number * @return int addition result */ function addNumbers($firstNum, $secondNum)
    11. 11. 3. Code re-use • Re-use code across projects • Refactor every now & then • Don’t Repeat Yourself (DRY)
    12. 12. 4. Code testing • Gives confidence • Unit testing in rescue • Test Driven Development (TDD)
    13. 13. • PHPUnit - http://www.phpunit.de • SimpleTest - http://www.simpletest.org
    14. 14. 5. PHP Framework • Forces good structure • Ready to use libraries • Solves most real-life problems 80% - 20%
    15. 15. • Zend Framework - http://framework.zend.com • CodeIgniter - http://www.codeigniter.com • CakePHP - http://cakephp.org/ • Symfony - http://www.symfony-project.org
    16. 16. 6. Source Control (SCM) • Your own personal UNDO • Compare, rollback, track source code • Must for team collaboration
    17. 17. • Subversion - http://subversion.tigris.org • Git - http://git-scm.com
    18. 18. 7. PHP IDE • Increased productivity • Reduced error in code • Debugging, profiling
    19. 19. • Eclipse PDT http://www.eclipse.org/pdt • Netbeans IDE http://www.netbeans.org • NuSphere PHPEd http://www.nusphere.com • Zend Studio for Eclipse http://www.zend.com/en/products/studio
    20. 20. 8. Quality Code Your PHP code should – be simple – get the job done – be secure – be scalable – be maintainable
    21. 21. PERSONAL DEVELOPMENT
    22. 22. 9. Being Communicative • Increased productivity • Reduces confusion • Builds synergy in team
    23. 23. 10. Being Agile • Working iteratively and incrementally • Being responsible • Being open minded
    24. 24. 11. Updating yourself • Trying new technology • Reading blogs • Get updated through RSS
    25. 25. • Planet PHP – http://planet-php.net • PHPDeveloper – http://phpdeveloper.org • Sitepoint – http://sitepoint.com • PHP Classes – http://phpclasses.org
    26. 26. 12. Community involvement • Starting to write blog • Participate in forum and communities • Contribute in open source projects
    27. 27. Questions?
    28. 28. Contact +880 161 PHPFOUR @phpfour phpfour@gmail.com http://www.phpfour.com/blog
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×