SlideShare uma empresa Scribd logo
1 de 33
Baixar para ler offline
B-S-T
                             easy as
                               1-2-3
                             Best Practices, Standards & Tools/Tips
                                           to make your life simpler




Sunday, September 27, 2009
What’s the Point?
                              Good development is good, but
                               better development kicks ass.
                             If it can be done easier and better
                                with less effort - why not?



Sunday, September 27, 2009
Best
  Practices
Sunday, September 27, 2009
Best Practices
                         A Best Practice is a technique, method, process, activity, incentive or reward
                         that is believed to be more effective at delivering a particular outcome than any
                         other technique, method, process, etc. The idea is that with proper processes,
                         checks, and testing, a desired outcome can be delivered with fewer problems
                         and unforeseen complications. Best practices can also be defined as the most
                         efficient (least amount of effort) and effective (best results) way of
                         accomplishing a task, based on repeatable procedures that have proven
                         themselves over time for large numbers of people.
                          
                         Wikipedia: http://en.wikipedia.org/wiki/Best_practice




Sunday, September 27, 2009
Sunday, September 27, 2009
Best Practices
                                                      (the best part)

                         By definition, best practices are what any group of developers and professionals
                         have decided work best for any given situation. This means they’re opinions
                         that have been confirmed by others, but it doesn’t mean that they’re law.

                         Any developer can suggest a new practice at any time. Every developer has
                         their own speciality. Find your niche and suggest away!




Sunday, September 27, 2009
Best Practices : What
                         - Not just about PHP. Think bigger.
                         - Best makes better
                         - Biggest bang for the buck
                         - Defining them is hard (no, really)




Sunday, September 27, 2009
Best Practices : Good
                         - Hit the ground running
                         - Helps you consider the important things
                         - Defines a set of “rules” you can use
                         - Keeps you current




Sunday, September 27, 2009
Best Practices : Bad
                         - Do more harm than good
                         - Understand! or don’t implement
                         - “Old wine in new bottles”
                         - Best? or Just Good Enough?
                         - Skip to the good parts
                         - Consider the future




Sunday, September 27, 2009
Best Practices : Consider
                         - How to benchmark the results
                         - Have the knowledge in-house
                         - Remember to innovate!




Sunday, September 27, 2009
Best Practices : PHP
            - Unit testing              - Source control
            - Documentation             - Well-structured
            - Standardized Deployment   - Integration tests
            - Design patterns           - Benchmarking
                                        - Coding standards




Sunday, September 27, 2009
Standards
Sunday, September 27, 2009
Standards
                         A technical standard is an established norm or requirement. It is usually a
                         formal document that establishes uniform engineering or technical criteria,
                         methods, processes and practices. A technical standard may be developed
                         privately or unilaterally, for example by a corporation, regulatory body, military,
                         etc. Standards can also be developed by groups such as trade unions, and trade
                         associations.

                         Wikipedia: http://en.wikipedia.org/wiki/Standards




Sunday, September 27, 2009
Standards : What
                         - Not just about PHP. Think bigger.
                         - Proven excellence
                         - Regularly used by a certain group or project




Sunday, September 27, 2009
Standards : What
                         - Naming conventions
                         - Variable definitions
                         - Commenting styles (like DocBlock)
                         - Use of external libraries
                         - How things fit together




Sunday, September 27, 2009
Standards : Good
                         - Levels the playing field
                         - Easier to get in on the game
                         - Can reduce the small issues
                         - Public standards make for easier integration




Sunday, September 27, 2009
Standards : Bad
                         - Where’s the quality control?
                         - Too strict?
                         - Could stifle creativity
                         - Poor implementation




Sunday, September 27, 2009
Standards : Consider
                         - Will it work for your group?
                         - Does the team size warrant the effort?
                         - Will the team accept it?
                         - Think wide, then narrow




Sunday, September 27, 2009
Are they required for success?
                                     Hint: no.




Sunday, September 27, 2009
Tools &
Tips
Sunday, September 27, 2009
Tools & Tips
                         Tools you can use to help encourage, enforce, plan
                         out, etc.
                         Helpful hints and tips on their implementation




Sunday, September 27, 2009
Tools & Tips
                                           Standards

                         - PHP_CodeSniffer (PEAR)
                         - Zend, PEAR, PHPCS, Squiz & MySource




Sunday, September 27, 2009
Tools & Tips
                                            Standards
                              Example PHP_CodeSniffer Output

         $ phpcs /path/to/code/myfile.php

         FILE: /path/to/code/myfile.php
         --------------------------------------------------------------------------------
         FOUND 5 ERROR(S) AND 1 WARNING(S) AFFECTING 5 LINE(S)
         --------------------------------------------------------------------------------
           2 | ERROR   | Missing file doc comment
          20 | ERROR   | PHP keywords must be lowercase; expected "false" but found
             |         | "FALSE"
          47 | ERROR   | Line not indented correctly; expected 4 spaces but found 1
          47 | WARNING | Equals sign not aligned with surrounding assignments
          51 | ERROR   | Missing function doc comment
          88 | ERROR   | Line not indented correctly; expected 9 spaces but found 6
         --------------------------------------------------------------------------------




Sunday, September 27, 2009
Tools & Tips
                                            Standards

                         - PHP_CodeSniffer (PEAR)
                         - Zend, PEAR, PHPCS, Squiz & MySource
                         - Other Documentation source (like wiki/shared resource)




Sunday, September 27, 2009
Tools & Tips
                                                       Testing
                                  - PHPUnit                             phpunit.de


                             <?php
                             class MySimpleClassTest extends PHPUnit_Framework_TestCase {
                                private $_cvar = ‘test’;
                                function testMyExample(){
                                   $val=‘test’;
                                   $this->assertEquals($val,$this->_cvar);
                                }
                             }
                             ?>




Sunday, September 27, 2009
Tools & Tips
                                                       Testing
                                  - PHPUnit                             phpunit.de

                                  - SimpleTest                          simpletest.org

                             <?php
                             class MySimpleClassTest extends UnitTestCase {
                                private $_cvar = ‘test’;
                                function testMyExample(){
                                   $val=‘test’;
                                   $this->assertEqual($val,$this->_cvar);
                                }
                             }
                             ?>




Sunday, September 27, 2009
Tools & Tips
                                            Testing
                             - PHPUnit                phpunit.de

                             - SimpleTest             simpletest.org

                             - Selenium               seleniumhq.org

                             - WebTest                webtest.canoo.com




Sunday, September 27, 2009
Tools & Tips
                                            Testing
                             - PHPUnit                phpunit.de

                             - SimpleTest             simpletest.org

                             - Selenium               seleniumhq.org

                             - WebTest                webtest.canoo.com

                             - ab & siege             joedog.org




Sunday, September 27, 2009
Tools & Tips
                                            Deployment
                             - Capistrano            capify.org

                             - Ant                   ant.apache.org

                             - Phing                 phing.info




Sunday, September 27, 2009
Tools & Tips
                                       Deployment - Phing
   <?xml version=”1.0”>
   <project name=”deploy_me” default=”main”>
      <property name=”version” value=”1.0” />

      <target name=”unittest”>
         <phpunit>
             <batchtest>
                <fileset dir=”/www/mysite/tests”>
                   <include name=”**/*Test*.php” />
                </fileset>
             </batchtest>
         </phpunit>
      </target>
      <target name=”phpdoc” depends=”unittest”>
         <phpdoc title=”MySite Documentation” destdir=”/www/mysite/docs” output=”HTML:Smarty:PHP”>
             <fileset dir=”/www/mysite/docroot”>
                <include name=”**/*.php” />
             </fileset>
         </phpdoc>
      </target>
      <target name=”lintme” depends=”phpdoc”>
         <phplint>
             <fileset dir=”/www/mysite/docroot”>
                <include name=”**/*.php” />
             </fileset>
         </phplint>
      </target>
      <target name=”standardsplz” depends=”lintme”>
         <phpcodesniffer standard=”PEAR” format=”summary” file=”/www/mysite/docroot”
             allowedFileExtensions=”php php5 inc” />
      </target>
      <target name=”main” depends=”standardsplz”>
      </target>
   </project>



Sunday, September 27, 2009
Tools & Tips
                                               Deployment
                             - Capistrano               capify.org

                             - Ant                      ant.apache.org

                             - Phing                    phing.info

                             - CruiseControl            cruisecontrol.sourceforge.net

                             - phpUnderControl          phpundercontrol.org




Sunday, September 27, 2009
Work
                                     Smarter
                                      Faster
                                      Better
                                          (best?)




                             ...and don’t forget to share!

Sunday, September 27, 2009
Thats It!
                                         Contact, Credits
                                            Chris Cornutt
                                       ccornutt@phpdeveloper.org


                               @enygma
                             @phpdeveloper
                               @joindin
                              @dallasphp                                          http://DallasPHP.org


                               Rate this talk at: http://joind.in/719
                                                        Photo Credits:
                                                    easy button (Jason Gulledge)
                                           http://www.flickr.com/photos/ramdac/373881476/

                                                         red structure: struttura
                                     http://www.flickr.com/photos/cane_rosso/1748958423/sizes/o/

                                                  Dreaming of Diamonds (Swamibu)
                                         http://www.flickr.com/photos/swamibu/1182138940/

Sunday, September 27, 2009

Mais conteúdo relacionado

Semelhante a B-S-T Easy as 1-2-3: Best Practices, Standards & Tools Tips

Scrum plus – why scrum is not enough for successful delivery
Scrum plus – why scrum is not enough for successful deliveryScrum plus – why scrum is not enough for successful delivery
Scrum plus – why scrum is not enough for successful deliveryNaveen Kumar Singh
 
Using standards for GOOD in DevOps
Using standards for GOOD in DevOpsUsing standards for GOOD in DevOps
Using standards for GOOD in DevOpsNeil McCaughley
 
Normalizing agile and lean product development and aim
Normalizing agile and lean product development and aimNormalizing agile and lean product development and aim
Normalizing agile and lean product development and aimRussell Pannone
 
Smooth running: ensure your systems training projects run without a hitch
Smooth running: ensure your systems training projects run without a hitchSmooth running: ensure your systems training projects run without a hitch
Smooth running: ensure your systems training projects run without a hitchBrightwave Group
 
Development Environment Tips
Development Environment TipsDevelopment Environment Tips
Development Environment TipsAdam Culp
 
Behind the demo, Alexey Syrotyuk
Behind the demo, Alexey SyrotyukBehind the demo, Alexey Syrotyuk
Behind the demo, Alexey SyrotyukSigma Software
 
Scrum Agile Methodlogy
Scrum Agile MethodlogyScrum Agile Methodlogy
Scrum Agile MethodlogyBahaa Farouk
 
Best Practices - Seeqnce - 23/24-02-2012
Best Practices - Seeqnce - 23/24-02-2012Best Practices - Seeqnce - 23/24-02-2012
Best Practices - Seeqnce - 23/24-02-2012Youssef Chaker
 
Things To Unlearn In Software Development
Things To Unlearn In Software DevelopmentThings To Unlearn In Software Development
Things To Unlearn In Software DevelopmentAlexey Krivitsky
 
The voyage toward agility
The voyage toward agilityThe voyage toward agility
The voyage toward agilityDan LeFebvre
 
DrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & ProfitableDrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & ProfitablePromet Source
 
Testing technology products
Testing technology productsTesting technology products
Testing technology productsDave Kreimer
 
Making Support Fun & Profitable: DrupalCon Portland
Making Support Fun & Profitable: DrupalCon Portland Making Support Fun & Profitable: DrupalCon Portland
Making Support Fun & Profitable: DrupalCon Portland Anne Stefanyk
 
Test Improvement - Any place, anytime, any where
Test Improvement - Any place, anytime, any whereTest Improvement - Any place, anytime, any where
Test Improvement - Any place, anytime, any whereRuud Teunissen
 
The Role of a BA on a Scrum Team IIBA Presentation 2010
The Role of a BA on a Scrum Team IIBA Presentation 2010The Role of a BA on a Scrum Team IIBA Presentation 2010
The Role of a BA on a Scrum Team IIBA Presentation 2010scrummasternz
 
Mod 6 - Agile Scrum in a nutshell.pdf
Mod 6 - Agile Scrum in a nutshell.pdfMod 6 - Agile Scrum in a nutshell.pdf
Mod 6 - Agile Scrum in a nutshell.pdfLuongMinhHai
 
Scrum Principles, Practices and Techniques - Texavi Tech Bootcamp on How to b...
Scrum Principles, Practices and Techniques - Texavi Tech Bootcamp on How to b...Scrum Principles, Practices and Techniques - Texavi Tech Bootcamp on How to b...
Scrum Principles, Practices and Techniques - Texavi Tech Bootcamp on How to b...Texavi Innovative Solutions
 

Semelhante a B-S-T Easy as 1-2-3: Best Practices, Standards & Tools Tips (20)

Professionalism
ProfessionalismProfessionalism
Professionalism
 
Scrum plus – why scrum is not enough for successful delivery
Scrum plus – why scrum is not enough for successful deliveryScrum plus – why scrum is not enough for successful delivery
Scrum plus – why scrum is not enough for successful delivery
 
Using standards for GOOD in DevOps
Using standards for GOOD in DevOpsUsing standards for GOOD in DevOps
Using standards for GOOD in DevOps
 
Normalizing agile and lean product development and aim
Normalizing agile and lean product development and aimNormalizing agile and lean product development and aim
Normalizing agile and lean product development and aim
 
Smooth running: ensure your systems training projects run without a hitch
Smooth running: ensure your systems training projects run without a hitchSmooth running: ensure your systems training projects run without a hitch
Smooth running: ensure your systems training projects run without a hitch
 
Development Environment Tips
Development Environment TipsDevelopment Environment Tips
Development Environment Tips
 
Behind the demo, Alexey Syrotyuk
Behind the demo, Alexey SyrotyukBehind the demo, Alexey Syrotyuk
Behind the demo, Alexey Syrotyuk
 
Scrum Agile Methodlogy
Scrum Agile MethodlogyScrum Agile Methodlogy
Scrum Agile Methodlogy
 
Best Practices - Seeqnce - 23/24-02-2012
Best Practices - Seeqnce - 23/24-02-2012Best Practices - Seeqnce - 23/24-02-2012
Best Practices - Seeqnce - 23/24-02-2012
 
Things To Unlearn In Software Development
Things To Unlearn In Software DevelopmentThings To Unlearn In Software Development
Things To Unlearn In Software Development
 
The voyage toward agility
The voyage toward agilityThe voyage toward agility
The voyage toward agility
 
DrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & ProfitableDrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & Profitable
 
Testing technology products
Testing technology productsTesting technology products
Testing technology products
 
Game Design Process
Game Design ProcessGame Design Process
Game Design Process
 
Prototype to production a startup perspective
Prototype to production   a startup perspectivePrototype to production   a startup perspective
Prototype to production a startup perspective
 
Making Support Fun & Profitable: DrupalCon Portland
Making Support Fun & Profitable: DrupalCon Portland Making Support Fun & Profitable: DrupalCon Portland
Making Support Fun & Profitable: DrupalCon Portland
 
Test Improvement - Any place, anytime, any where
Test Improvement - Any place, anytime, any whereTest Improvement - Any place, anytime, any where
Test Improvement - Any place, anytime, any where
 
The Role of a BA on a Scrum Team IIBA Presentation 2010
The Role of a BA on a Scrum Team IIBA Presentation 2010The Role of a BA on a Scrum Team IIBA Presentation 2010
The Role of a BA on a Scrum Team IIBA Presentation 2010
 
Mod 6 - Agile Scrum in a nutshell.pdf
Mod 6 - Agile Scrum in a nutshell.pdfMod 6 - Agile Scrum in a nutshell.pdf
Mod 6 - Agile Scrum in a nutshell.pdf
 
Scrum Principles, Practices and Techniques - Texavi Tech Bootcamp on How to b...
Scrum Principles, Practices and Techniques - Texavi Tech Bootcamp on How to b...Scrum Principles, Practices and Techniques - Texavi Tech Bootcamp on How to b...
Scrum Principles, Practices and Techniques - Texavi Tech Bootcamp on How to b...
 

Último

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

B-S-T Easy as 1-2-3: Best Practices, Standards & Tools Tips

  • 1. B-S-T easy as 1-2-3 Best Practices, Standards & Tools/Tips to make your life simpler Sunday, September 27, 2009
  • 2. What’s the Point? Good development is good, but better development kicks ass. If it can be done easier and better with less effort - why not? Sunday, September 27, 2009
  • 3. Best Practices Sunday, September 27, 2009
  • 4. Best Practices A Best Practice is a technique, method, process, activity, incentive or reward that is believed to be more effective at delivering a particular outcome than any other technique, method, process, etc. The idea is that with proper processes, checks, and testing, a desired outcome can be delivered with fewer problems and unforeseen complications. Best practices can also be defined as the most efficient (least amount of effort) and effective (best results) way of accomplishing a task, based on repeatable procedures that have proven themselves over time for large numbers of people.   Wikipedia: http://en.wikipedia.org/wiki/Best_practice Sunday, September 27, 2009
  • 6. Best Practices (the best part) By definition, best practices are what any group of developers and professionals have decided work best for any given situation. This means they’re opinions that have been confirmed by others, but it doesn’t mean that they’re law. Any developer can suggest a new practice at any time. Every developer has their own speciality. Find your niche and suggest away! Sunday, September 27, 2009
  • 7. Best Practices : What - Not just about PHP. Think bigger. - Best makes better - Biggest bang for the buck - Defining them is hard (no, really) Sunday, September 27, 2009
  • 8. Best Practices : Good - Hit the ground running - Helps you consider the important things - Defines a set of “rules” you can use - Keeps you current Sunday, September 27, 2009
  • 9. Best Practices : Bad - Do more harm than good - Understand! or don’t implement - “Old wine in new bottles” - Best? or Just Good Enough? - Skip to the good parts - Consider the future Sunday, September 27, 2009
  • 10. Best Practices : Consider - How to benchmark the results - Have the knowledge in-house - Remember to innovate! Sunday, September 27, 2009
  • 11. Best Practices : PHP - Unit testing - Source control - Documentation - Well-structured - Standardized Deployment - Integration tests - Design patterns - Benchmarking - Coding standards Sunday, September 27, 2009
  • 13. Standards A technical standard is an established norm or requirement. It is usually a formal document that establishes uniform engineering or technical criteria, methods, processes and practices. A technical standard may be developed privately or unilaterally, for example by a corporation, regulatory body, military, etc. Standards can also be developed by groups such as trade unions, and trade associations. Wikipedia: http://en.wikipedia.org/wiki/Standards Sunday, September 27, 2009
  • 14. Standards : What - Not just about PHP. Think bigger. - Proven excellence - Regularly used by a certain group or project Sunday, September 27, 2009
  • 15. Standards : What - Naming conventions - Variable definitions - Commenting styles (like DocBlock) - Use of external libraries - How things fit together Sunday, September 27, 2009
  • 16. Standards : Good - Levels the playing field - Easier to get in on the game - Can reduce the small issues - Public standards make for easier integration Sunday, September 27, 2009
  • 17. Standards : Bad - Where’s the quality control? - Too strict? - Could stifle creativity - Poor implementation Sunday, September 27, 2009
  • 18. Standards : Consider - Will it work for your group? - Does the team size warrant the effort? - Will the team accept it? - Think wide, then narrow Sunday, September 27, 2009
  • 19. Are they required for success? Hint: no. Sunday, September 27, 2009
  • 21. Tools & Tips Tools you can use to help encourage, enforce, plan out, etc. Helpful hints and tips on their implementation Sunday, September 27, 2009
  • 22. Tools & Tips Standards - PHP_CodeSniffer (PEAR) - Zend, PEAR, PHPCS, Squiz & MySource Sunday, September 27, 2009
  • 23. Tools & Tips Standards Example PHP_CodeSniffer Output $ phpcs /path/to/code/myfile.php FILE: /path/to/code/myfile.php -------------------------------------------------------------------------------- FOUND 5 ERROR(S) AND 1 WARNING(S) AFFECTING 5 LINE(S) --------------------------------------------------------------------------------   2 | ERROR   | Missing file doc comment  20 | ERROR   | PHP keywords must be lowercase; expected "false" but found     |         | "FALSE"  47 | ERROR   | Line not indented correctly; expected 4 spaces but found 1  47 | WARNING | Equals sign not aligned with surrounding assignments  51 | ERROR   | Missing function doc comment  88 | ERROR   | Line not indented correctly; expected 9 spaces but found 6 -------------------------------------------------------------------------------- Sunday, September 27, 2009
  • 24. Tools & Tips Standards - PHP_CodeSniffer (PEAR) - Zend, PEAR, PHPCS, Squiz & MySource - Other Documentation source (like wiki/shared resource) Sunday, September 27, 2009
  • 25. Tools & Tips Testing - PHPUnit phpunit.de <?php class MySimpleClassTest extends PHPUnit_Framework_TestCase { private $_cvar = ‘test’; function testMyExample(){ $val=‘test’; $this->assertEquals($val,$this->_cvar); } } ?> Sunday, September 27, 2009
  • 26. Tools & Tips Testing - PHPUnit phpunit.de - SimpleTest simpletest.org <?php class MySimpleClassTest extends UnitTestCase { private $_cvar = ‘test’; function testMyExample(){ $val=‘test’; $this->assertEqual($val,$this->_cvar); } } ?> Sunday, September 27, 2009
  • 27. Tools & Tips Testing - PHPUnit phpunit.de - SimpleTest simpletest.org - Selenium seleniumhq.org - WebTest webtest.canoo.com Sunday, September 27, 2009
  • 28. Tools & Tips Testing - PHPUnit phpunit.de - SimpleTest simpletest.org - Selenium seleniumhq.org - WebTest webtest.canoo.com - ab & siege joedog.org Sunday, September 27, 2009
  • 29. Tools & Tips Deployment - Capistrano capify.org - Ant ant.apache.org - Phing phing.info Sunday, September 27, 2009
  • 30. Tools & Tips Deployment - Phing <?xml version=”1.0”> <project name=”deploy_me” default=”main”> <property name=”version” value=”1.0” /> <target name=”unittest”> <phpunit> <batchtest> <fileset dir=”/www/mysite/tests”> <include name=”**/*Test*.php” /> </fileset> </batchtest> </phpunit> </target> <target name=”phpdoc” depends=”unittest”> <phpdoc title=”MySite Documentation” destdir=”/www/mysite/docs” output=”HTML:Smarty:PHP”> <fileset dir=”/www/mysite/docroot”> <include name=”**/*.php” /> </fileset> </phpdoc> </target> <target name=”lintme” depends=”phpdoc”> <phplint> <fileset dir=”/www/mysite/docroot”> <include name=”**/*.php” /> </fileset> </phplint> </target> <target name=”standardsplz” depends=”lintme”> <phpcodesniffer standard=”PEAR” format=”summary” file=”/www/mysite/docroot” allowedFileExtensions=”php php5 inc” /> </target> <target name=”main” depends=”standardsplz”> </target> </project> Sunday, September 27, 2009
  • 31. Tools & Tips Deployment - Capistrano capify.org - Ant ant.apache.org - Phing phing.info - CruiseControl cruisecontrol.sourceforge.net - phpUnderControl phpundercontrol.org Sunday, September 27, 2009
  • 32. Work Smarter Faster Better (best?) ...and don’t forget to share! Sunday, September 27, 2009
  • 33. Thats It! Contact, Credits Chris Cornutt ccornutt@phpdeveloper.org @enygma @phpdeveloper @joindin @dallasphp http://DallasPHP.org Rate this talk at: http://joind.in/719 Photo Credits: easy button (Jason Gulledge) http://www.flickr.com/photos/ramdac/373881476/ red structure: struttura http://www.flickr.com/photos/cane_rosso/1748958423/sizes/o/ Dreaming of Diamonds (Swamibu) http://www.flickr.com/photos/swamibu/1182138940/ Sunday, September 27, 2009