SlideShare a Scribd company logo
1 of 28
Download to read offline
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: SWI, Pageflakes, Trippert Labs.

</about>
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)))
{
   displayGraph($value);
}
• 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
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 int first number
* @param int second number
* @return int addition result
*/
function addNumbers($firstNum, $secondNum)
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% - 20%
•   Zend Framework - http://framework.zend.com
•   CodeIgniter - http://www.codeigniter.com
•   CakePHP - http://cakephp.org/
•   Symfony - http://www.symfony-project.org
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.nusphere.com

• Zend Studio for Eclipse
  http://www.zend.com/en/products/studio
8. Quality Code
Your PHP code should
  – be simple

  – get the job done

  – be secure

  – be scalable

  – be maintainable
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 Classes – http://phpclasses.org
12. Community involvement
• Starting to write blog

• Participate in forum and communities

• Contribute in open source projects
Questions?
Contact

    +880 161 PHPFOUR
        @phpfour
    phpfour@gmail.com
http://www.phpfour.com/blog

More Related Content

What's hot

What's hot (20)

Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
mod_php vs FastCGI vs FPM vs CLI
mod_php vs FastCGI vs FPM vs CLImod_php vs FastCGI vs FPM vs CLI
mod_php vs FastCGI vs FPM vs CLI
 
Why Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your ClientsWhy Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your Clients
 
Containerizing legacy applications
Containerizing legacy applicationsContainerizing legacy applications
Containerizing legacy applications
 
Behaviour testing for single-page applications and API’s
Behaviour testing for single-page applications and API’sBehaviour testing for single-page applications and API’s
Behaviour testing for single-page applications and API’s
 
The Themer's Guide to WP-CLI
The Themer's Guide to WP-CLIThe Themer's Guide to WP-CLI
The Themer's Guide to WP-CLI
 
Using Zend Framework 2 Book Presentation
Using Zend Framework 2 Book PresentationUsing Zend Framework 2 Book Presentation
Using Zend Framework 2 Book Presentation
 
Continuous Integration Is for Teams: Moving past buzzword driven development
Continuous Integration Is for Teams: Moving past buzzword driven development Continuous Integration Is for Teams: Moving past buzzword driven development
Continuous Integration Is for Teams: Moving past buzzword driven development
 
Stop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal developmentStop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal development
 
FuelPHP presentation - PeoplePerHour workshop
FuelPHP presentation - PeoplePerHour workshopFuelPHP presentation - PeoplePerHour workshop
FuelPHP presentation - PeoplePerHour workshop
 
FuelPHP
FuelPHPFuelPHP
FuelPHP
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio Code
 
wp-cli and plugin development with future and past compatibility (Word Camp P...
wp-cli and plugin development with future and past compatibility (Word Camp P...wp-cli and plugin development with future and past compatibility (Word Camp P...
wp-cli and plugin development with future and past compatibility (Word Camp P...
 
FuelPHP - a PHP HMVC Framework by silicongulf.com
FuelPHP - a PHP HMVC Framework by silicongulf.comFuelPHP - a PHP HMVC Framework by silicongulf.com
FuelPHP - a PHP HMVC Framework by silicongulf.com
 
Improving qa on php projects
Improving qa on php projectsImproving qa on php projects
Improving qa on php projects
 
10 things you should know about django
10 things you should know about django10 things you should know about django
10 things you should know about django
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
 

Similar to Becoming A Php Ninja

Introduction into PHP5 (Jeroen van Sluijs)
Introduction into PHP5 (Jeroen van Sluijs)Introduction into PHP5 (Jeroen van Sluijs)
Introduction into PHP5 (Jeroen van Sluijs)
Stefan Koopmanschap
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
Fabien Potencier
 
Best Practices with Zend Framework - Matthew Weier O'Phinney
Best Practices with Zend Framework - Matthew Weier O'PhinneyBest Practices with Zend Framework - Matthew Weier O'Phinney
Best Practices with Zend Framework - Matthew Weier O'Phinney
dpc
 

Similar to Becoming A Php Ninja (20)

Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...
 
Api Design
Api DesignApi Design
Api Design
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)
 
Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009
 
How To Become A Php Geek
How To Become A Php GeekHow To Become A Php Geek
How To Become A Php Geek
 
Introduction into PHP5 (Jeroen van Sluijs)
Introduction into PHP5 (Jeroen van Sluijs)Introduction into PHP5 (Jeroen van Sluijs)
Introduction into PHP5 (Jeroen van Sluijs)
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 
Test
TestTest
Test
 
Introduction to Using PHP & MVC Frameworks
Introduction to Using PHP & MVC FrameworksIntroduction to Using PHP & MVC Frameworks
Introduction to Using PHP & MVC Frameworks
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Improving WordPress Performance: Xdebug and PHP profiling
Improving WordPress Performance: Xdebug and PHP profilingImproving WordPress Performance: Xdebug and PHP profiling
Improving WordPress Performance: Xdebug and PHP profiling
 
Best Practices with Zend Framework - Matthew Weier O'Phinney
Best Practices with Zend Framework - Matthew Weier O'PhinneyBest Practices with Zend Framework - Matthew Weier O'Phinney
Best Practices with Zend Framework - Matthew Weier O'Phinney
 
Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)
 
Northeast PHP - High Performance PHP
Northeast PHP - High Performance PHPNortheast PHP - High Performance PHP
Northeast PHP - High Performance PHP
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for Eclipse
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpress
 
Streamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web FrameworksStreamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web Frameworks
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Becoming A Php Ninja

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

Editor's Notes

  1. Naming conventionFunction name – meaningfulIndentationUse of white space and new line<number>
  2. <number>
  3. <number>
  4. <number>