Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dotting your i's and crossing your t's - how to...

Dotting your i's and crossing your t's - how to make good code great

Presented on May 10th 2014 at WordCamp NL, Utrecht, The Netherlands.
http://2014.netherlands.wordcamp.org/
---------------------------------------------------------------
Ever had to go back to code you did over a year ago ? And… did you like it ?

We all *love* well documented, testable, easily readable and understandable code. But how do you write it ? and what tools are available to help you ?
What can you do *now* to make your life and the life of your successor(s) and users easier ?

Learn how to avoid a build up of technical debt and make your good code awesome!

---------------------------------------------------------------

If you download the slides, the links should be clickable. Unfortunately they don't seem to be in the online deck, so here's a list of the links:

Slide 10
Types of Technical Debt: http://www.martinfowler.com/bliki/TechnicalDebtQuadrant.html

Slide 11
How Quality affects software costs: http://www.sqgne.org/presentations/2010-11/Jones-Nov-2010.pdf

Slide 12
PHPUnderControl: http://phpundercontrol.org/
Sonar: http://www.sonarsource.com/

Slide 17 - Debugging tools:
XDEBUG: http://xdebug.org/
PHP lint: http://www.icosaedro.it/phplint/
JS lint + hint: http://www.jslint.com/ , http://www.javascriptlint.com/ , http://www.jshint.com/
Debug Bar plugins: https://wordpress.org/plugins/search.php?q=debug+bar
Firebug: http://getfirebug.com/
Profile: https://github.com/joehoyle/Time-Stack
Profile plugins: http://wordpress.org/plugins/p3-profiler/

Slide 18 - Educate yourself:
WP Codex: http://codex.wordpress.org/
WP Dev Reference: http://developer.wordpress.org/reference/
PHP manual: http://php.net/manual
Jquery manual: http://api.jquery.com/
phpcheatsheets.com: http://phpcheatsheets.com/
OWASP top 10: http://owasp.org/

Slide 21
WP Coding standards: http://make.wordpress.org/core/handbook/coding-standards/ and https://github.com/Automattic/PhpStorm-Resources

Slide 22
PHP Code Sniffer: http://pear.php.net/package/PHP_CodeSniffer/

Slide 23
WP ruleset for PHPCS: https://github.com/WordPress-Coding-Standards/

Slide 26
Webbased PHP code sniffer: http://www.webcodesniffer.net/

Slide 27
PHP cross-version compatibility ruleset for PHPCS: https://github.com/wimg/PHPCompatibility

Slide 32
WP Documentation standards: http://make.wordpress.org/core/handbook/inline-documentation-standards/php-documentation-standards/

Slide 37
PHPDocumentor: http://www.phpdoc.org/
PHPDox: http://phpdox.de/
WP Documentor (proof of concept): https://github.com/jrfnl/wp-hook-documentor

Slide 41
PHPUnit: http://phpunit.de/

Slide 43
WP handbook on automated testing: http://make.wordpress.org/core/handbook/automated-testing/
WP unit test suite: https://unit-tests.svn.wordpress.org/trunk/tests/
WP testing with mocking: https://github.com/10up/wp_mock

Slide 47
pDepend: http://pdepend.org/
PHPLOC: https://github.com/sebastianbergmann/phploc

Slide 48
PHP Mess Detector: http://phpmd.org/

Slide 49
PHP Copy Paste Detector: https://github.com/sebastianbergmann/phpcpd

Slide 50
PHP Dead Code Detector: https://github.com/sebastianbergmann/phpdcd

Slide 55
Git hooks: http://git-scm.com/docs/githooks.html and http://git-scm.com/book/en/Customizing-Git-Git-Hooks
Phing: http://www.phing.info/
Grunt: http://gruntjs.com/
Capistrano: http://capistranorb.com/
Sonar: http://www.sonarsource.com/
Jenkins: http://jenkins-ci.org/
Travis: https://travis-ci.org/

Slide 57
Bonus link: http://stilldrinking.org/programming-sucks

Slide 58
Geek and Poke: http://geek-and-poke.com/
OSNews: http://osnews.com/comics

More Decks by Juliette Reinders Folmer

Other Decks in Programming

Transcript

  1. Dotting your i's and crossing your t's How to make

    good code GREAT Juliette Reinders Folmer WordCamp NL 2014
  2. Who am I? Self- employed independent consultant 15+ years in

    IT and web development Zend Certified Engineer PHPCheatsheets.com Contributor to LimeSurvey, phpBB, WP, AdoDB and more Author of several WP plugins and contributor/bug fixer for many more
  3. Technical Debt Potential defects Coding style Documentation Code coverage Code

    duplication Code complexity Unshared knowledge or code Unstable deployment process Outdated third party dependencies
  4. Prevent Bugs Apply best practices • APIs • Security •

    Avoid conflict • Lean & mean • Hook in • Translatability
  5. Prevent Bugs Apply best practices Use debugging tools • XDEBUG

    • PHP lint • JS lint + hint • Debug Bar plugins • Firebug + extensions • Profile • Profile plugins
  6. Prevent Bugs Apply best practices Use debugging tools Educate yourself

    • WP Codex • WP Dev Reference • PHP manual • Jquery manual • phpcheatsheets.com • OWASP top 10 • Conferences !
  7. Liked the cartoons ? Exception: the WTF Quality cartoon by

    Thom Holwerda – OSNews.com Geek and Poke is a creation of Oliver Widder Cartoons used with gracious CC permission Visit geek-and-poke.com for more !
  8. Keep in touch! (I’m self-employed, you can hire me ;-)

    ) Juliette Reinders Folmer Email: [email protected] Web: http://www.adviesenzo.nl/ LinkedIn: http://nl.linkedin.com/in/julietterf Twitter: http://twitter.com/jrf_nl GitHub: http://github.com/jrfnl/ WordPress: http://profiles.wordpress.org/jrf Slides will be posted to http://speakerdeck.com/jrf Endorsements and recommendations on LinkedIn are much appreciated !