Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Be a Bold Coder Beth Tucker Long
Who am I? Beth Tucker Long (@e3betht)
• PHP Developer • Stay-‐at-‐home mom • User group leader • Mentor & ApprenIce
Audience ParIcipaIon?
• Completely fine. Ask me quesIons any Ime.
Why?
Show of Hands
Why?
• Build confidence • Improve code quality and security • Easier integraIon
What this talk is not
A Bit of History
The "S" Word
Standards!
• PHP-‐FIG • Zend Framework • Symfony
Wait…MulIple Standards?
PHP-‐FIG
• PSR-‐1 Basic Coding Standard hYp://www.php-‐fig.org/psr/psr-‐1/ • PSR-‐2 Coding Style Standard hYp://www.php-‐fig.org/psr/psr-‐2/
PHP Coding Standards Fixer
hYp://cs.sensiolabs.org • Fixes "most" issues • PSR-‐1 and PSR-‐2 compliant
PHP_CodeSniffer
hYps://github.com/squizlabs/PHP_CodeSniffer • Phar, PEAR, or Composer • Preset and customizable standards • Will fix items for you automaIcally
PHP_CodeSniffer: Output
FILE: /myDir/myFile.php -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ FOUND 3 ERROR(S) AFFECTING 3 LINE(S)
-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ 2 | ERROR | [ ] Missing file doc comment 20 | ERROR | [x] PHP keywords must be lowercase; expected "false" but found "FALSE" 47 | ERROR | [x] Line not indented correctly; expected 4 spaces but found 1
PHP_CodeSniffer: Output
• Sublime Text hYp://www.sublimetext.com
• PhpStorm hYps://www.jetbrains.com/phpstorm/
• Vim hYp://www.vim.org
The "S" Word
Security
• hYp://php.net/manual/en/security.php • hYps://www.owasp.org/index.php/PHP_Security_Cheat_Sheet • hYp://websec.io
• Securing PHP: Core Concepts
hYps://leanpub.com/securingphp-‐coreconcepts hYps://speakerdeck.com/ccornuY hYp://securingphp.com
Security
• hYp://php.net/manual/en/security.php • hYps://www.owasp.org/index.php/PHP_Security_Cheat_Sheet • hYp://websec.io
• Securing PHP: Core Concepts
hYps://leanpub.com/securingphp-‐coreconcepts hYps://speakerdeck.com/ccornuY hYp://securingphp.com
Classes
• hYps://www.phparch.com/training/web-‐security/ • hYp://www.zend.com/en/services/training/security • hYps://www.pluralsight.com/courses/play-‐by-‐play-‐website-‐
security-‐review-‐troy-‐hunt-‐lars-‐klint • hYps://nomadphp.com/products/secure-‐password-‐hashing/
• Check your local user group
The "T" Word
TesIng
A liYle bit of extra work up front saves lots and lots of work later on.
Use a TesIng Framework
Chris Hartjes
@grmpyprogrammer hYp://grumpy-‐learning.com
Use a TesIng Framework
PHPUnit hYps://phpunit.de
The "D" Word
DocumenIng Your Code
• phpDocumentor: hYp://www.phpdoc.org/ • Automates documentaIon • Tutorial:
hYp://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html
/** * Put your short description here. * * Put your long description here. * You may use multiple lines. * You can even use Markdown. * * @author Beth Tucker Long <[email protected]> * * @since 1.0 * * @param int $exampleA This is a method parameter
description. * @param string $exampleB This is another example. */
Know Your Language!
php.net
Know Your Tools!
hYps://github.com/
Know Your Tools!
hYps://github.com/ Contribute!
Sensio Insight
hYps://insight.sensiolabs.com/ • Free for open source, integrated with Git • Symfony-‐focused, but works with any PHP code • Checks PHP, XML, YAML, Twig templates, and Composer dependencies
Sensio Insight
hYps://insight.sensiolabs.com/ • Free for open source, integrated with
Git • Symfony-‐focused, but works with any
PHP code • Checks PHP, XML, YAML, Twig
templates, and Composer dependencies
ScruInizer
hYps://scruInizer-‐ci.com/ • Free for open source • Integrated with Git • Integrates open source checking tools like PHP_CodeSniffer and PHP Mess Detector
• Checks PHP, Python, and Ruby
Code Climate
hYps://codeclimate.com/ • Free for open source • Integrated with Git • Checks PHP, JS, Ruby, and coming
soon -‐ Python • Takes security seriously:
codeclimate.com/security
Never Stop Learning
Learn by Reading
hYp://www.phparch.com/magazine/
hYp://www.phptherightway.com
hYp://phpdeveloper.org
Learn by Reading
hYps://leanpub.com
Amazon
Your local library
Learn by Reading
• Pocket -‐ can pin arIcles and gives you more recommendaIons for related arIcles
• Devdocs.io -‐ documentaIon for libraries and languages, etc.
• Libraries.io -‐ searches and gives you libraries to use
Learn by Watching
hYp://nomadphp.com hYps://www.youtube.com/user/phpukconference hYps://www.youtube.com/user/phpacademy/
hYp://www.pluralsight.com/ hYps://www.youtube.com/user/LevelUpTuts
hYps://github.com/phptodayorg/php-‐must-‐watch
Learn by InstrucIon
hYp://www.phparch.com/training/ hYp://www.zend.com/services/training
hYp://www.codecademy.com/en/tracks/php hYp://www.pluralsight.com/ Your Local User Group!!!!!
Learn by Listening
hYp://devhell.info hYp://looselycoupled.info hYp://phptownhall.com hYp://thatpodcast.io
hYp://phproundtable.com hYps://rungeekradio.com
hYps://voicesojheelephpant.com
Learn by PracIcing
hYps://laracasts.com/series/code-‐katas-‐in-‐php
hYp://codingdojo.org/cgi-‐bin/index.pl?KataCatalogue
hYp://phpcodepad.com
Learn by Email
hYp://securingphp.com
hYp://www.phpweekly.com
Learn by Mentoring
h"p://phpmentoring.org hYp://www.slideshare.net
hYp://www.joind.in hYp://php.net/conferences/
hYp://nocapes.net hYp://voicesojheelephpant.com
Learn by Mentoring
hYp://phpmentoring.org IRC Channels Stack Overflow
Learn by Hanging Out
Freenode hYps://webchat.freenode.net
#phpc #phpwomen
#phpmentoring
Learn by AYending
hYp://php.ug hYp://php.net/cal.php
hYp://www.meetup.com
User Groups
If there's not one near you, start one!
(and ask me to help)
Learn by Speaking
hYp://rosstuck.com/Ips-‐on-‐speaking/ hYp://maYhewturland.com/2014/07/15/speaking-‐
resources/ hYp://afilina.com/re-‐how-‐to-‐submit-‐to-‐conf/
hYp://www.aliYleoroth.com/2014/01/how-‐to-‐submit-‐a-‐talk-‐to-‐a-‐conference/
Find a Place to Speak
hYp://php.net/conferences hYp://joind.in/event/callforpapers
hYps://thecfpreport.com hYps://twiYer.com/callbackwomen
But, I'm SIll Anxious
Resources • hYp://teamtreehouse.com/library/standards-‐and-‐best-‐pracIces • hYp://code.tutsplus.com/tutorials/30-‐php-‐best-‐pracIces-‐for-‐beginners-‐-‐
net-‐6194 • hYps://www.airpair.com/php/posts/best-‐pracIces-‐for-‐modern-‐php-‐
development • hYps://phpbestpracIces.org/ • hYps://www.corephp.com/blog/php-‐best-‐pracIces-‐that-‐you-‐must-‐
follow/ • hYp://www.phpbuilder.com/arIcles/applicaIon-‐architecture/
opImizaIon/explore-‐the-‐top-‐11-‐php-‐best-‐pracIces.html • hYp://pear.php.net/manual/en/standards.bestpracIces.php • hYp://www.sitepoint.com/php-‐Ips-‐resources-‐best-‐pracIces-‐2015/
Final Thoughts Bold coding is, of course, about knowledge and skill, but more
importantly, it's about being acIve:
AcIvely Learning AcIvely ParIcipaIng AcIvely Improving
Find Me • TwiYer: e3betht
• Madison PHP User Group (Meetup) hYp://www.madisonphp.com
• Slides Available on: hYp://www.TreelineDesign.com/slides