SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à 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
 

Similaire à 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...
 

Dernier

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Dernier (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

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