Be a Bold Coder Beth Tucker Long @e3betht Who am I? - - PowerPoint PPT Presentation

be a bold coder
SMART_READER_LITE
LIVE PREVIEW

Be a Bold Coder Beth Tucker Long @e3betht Who am I? - - PowerPoint PPT Presentation

Be a Bold Coder Beth Tucker Long @e3betht Who am I? Beth Tucker Long (@e3betht) PHP Developer at Code Climate Stay-at-home


slide-1
SLIDE 1

Be ¡a ¡Bold ¡Coder ¡

Beth ¡Tucker ¡Long ¡ @e3betht ¡

slide-2
SLIDE 2

@e3betht

Who ¡am ¡I? ¡ Beth ¡Tucker ¡Long ¡ ¡ ¡(@e3betht) ¡

  • PHP ¡Developer ¡at ¡ ¡

Code ¡Climate ¡

  • Stay-­‑at-­‑home ¡mom ¡
  • User ¡group ¡leader ¡
  • Mentor ¡

¡ ¡

slide-3
SLIDE 3

@e3betht

Audience ¡ParIcipaIon? ¡

  • Completely ¡fine. ¡Ask ¡me ¡quesIons ¡any ¡Ime. ¡
slide-4
SLIDE 4

@e3betht

Why? ¡

slide-5
SLIDE 5

@e3betht

Why? ¡

  • Build ¡confidence ¡
  • Improve ¡code ¡quality ¡and ¡security ¡
  • Easier ¡integraIon ¡
slide-6
SLIDE 6 @e3betht

¡ ¡What ¡this ¡talk ¡is ¡not ¡

slide-7
SLIDE 7 @e3betht

¡ ¡

A ¡bit ¡of ¡history ¡

slide-8
SLIDE 8

@e3betht

Use ¡the ¡"S" ¡Word ¡

slide-9
SLIDE 9

@e3betht

Use ¡the ¡"S" ¡Word ¡

Standards! ¡

slide-10
SLIDE 10

@e3betht

Use ¡the ¡"S" ¡Word ¡

Wait, ¡mulIple ¡standards? ¡

slide-11
SLIDE 11

@e3betht

PHP-­‑FIG ¡

  • PSR-­‑1 ¡Basic ¡Coding ¡Standard ¡

hVp://www.php-­‑fig.org/psr/psr-­‑1/ ¡ ¡ ¡

  • PSR-­‑2 ¡Coding ¡Style ¡Standard ¡

hVp://www.php-­‑fig.org/psr/psr-­‑2/ ¡ ¡

slide-12
SLIDE 12

@e3betht

PHP ¡Coding ¡Standards ¡Fixer ¡

hVp://cs.sensiolabs.org ¡ ¡

  • Fixes ¡"most" ¡issues ¡
  • PSR-­‑1 ¡and ¡PSR-­‑2 ¡compliant ¡
slide-13
SLIDE 13

@e3betht

PHP_CodeSniffer ¡

hVps://github.com/squizlabs/PHP_CodeSniffer ¡ ¡ ¡ ¡

  • Phar, ¡PEAR, ¡or ¡Composer ¡
  • Preset ¡and ¡customizable ¡standards ¡
  • Will ¡fix ¡items ¡for ¡you ¡automaIcally ¡
slide-14
SLIDE 14

@e3betht

Output ¡

$ ¡phpcs ¡/myDir/myFile.php ¡ 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 ¡

  • ­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡
slide-15
SLIDE 15

@e3betht

IDEs ¡

  • Sublime ¡Text ¡

hVp://www.sublimetext.com ¡ ¡ ¡

  • PhpStorm ¡

hVps://www.jetbrains.com/phpstorm/ ¡ ¡

  • Vim ¡

hVp://www.vim.org ¡ ¡

slide-16
SLIDE 16

@e3betht

Use ¡the ¡other ¡"S" ¡Word ¡

slide-17
SLIDE 17

@e3betht

Use ¡the ¡other ¡"S" ¡Word ¡

¡ Security ¡

slide-18
SLIDE 18

@e3betht

Security ¡

  • hVp://php.net/manual/en/security.php ¡
  • hVps://www.owasp.org/index.php/

PHP_Security_Cheat_Sheet ¡

  • hVp://websec.io ¡ ¡

¡

  • Securing ¡PHP: ¡Core ¡Concepts ¡

hVps://leanpub.com/securingphp-­‑coreconcepts ¡ hVps://speakerdeck.com/ccornuV ¡ ¡ hVp://securingphp.com ¡ ¡

slide-19
SLIDE 19

@e3betht

Test ¡Your ¡Code ¡

A ¡liVle ¡bit ¡of ¡extra ¡work ¡up ¡front ¡ saves ¡lots ¡and ¡lots ¡of ¡work ¡later ¡on. ¡

slide-20
SLIDE 20

@e3betht

Need ¡Help ¡with ¡TesIng? ¡

Chris ¡Hartjes ¡ ¡ @grmpyprogrammer ¡ ¡ hVp://grumpy-­‑learning.com ¡ ¡

slide-21
SLIDE 21

@e3betht

Use ¡a ¡TesIng ¡Framework ¡

PHPUnit ¡ hVps://phpunit.de ¡ ¡

slide-22
SLIDE 22

@e3betht

¡ ¡

Document ¡Your ¡Code ¡

Make ¡sure ¡everyone ¡knows ¡ what ¡your ¡code ¡is ¡doing… ¡ including ¡you. ¡

slide-23
SLIDE 23

@e3betht

¡ ¡

Document ¡Your ¡Code ¡

phpDocumentor: ¡hVp://www.phpdoc.org/ ¡ ¡ ¡

  • Automates ¡documentaIon ¡
  • Tutorial: ¡

hVp://manual.phpdoc.org/HTMLSmartyConverter/ HandS/phpDocumentor/ tutorial_phpDocumentor.howto.pkg.html ¡ ¡

slide-24
SLIDE 24 @e3betht

¡ ¡

/** ¡ ¡ ¡* ¡Put ¡your ¡short ¡descripIon ¡here. ¡ ¡ ¡* ¡ ¡ ¡ ¡* ¡Put ¡your ¡long ¡descripIon ¡here. ¡ ¡ ¡ ¡* ¡You ¡may ¡use ¡mulIple ¡lines. ¡ ¡ ¡* ¡You ¡can ¡even ¡use ¡Markdown. ¡ ¡ ¡* ¡ ¡ ¡* ¡@author ¡ ¡Beth ¡Tucker ¡Long ¡<beth@musketeers.me> ¡ ¡ ¡* ¡ ¡ ¡* ¡@since ¡1.0 ¡ ¡ ¡* ¡ ¡ ¡* ¡@param ¡int ¡$exampleA ¡ ¡This ¡is ¡a ¡method ¡parameter ¡descripIon. ¡ ¡ ¡* ¡@param ¡string ¡$exampleB ¡This ¡is ¡another ¡example. ¡ ¡ ¡*/ ¡
slide-25
SLIDE 25 @e3betht

¡ ¡

slide-26
SLIDE 26

@e3betht

Know ¡Your ¡Language ¡

php.net ¡

slide-27
SLIDE 27 @e3betht

¡ ¡

slide-28
SLIDE 28 @e3betht

¡ ¡

slide-29
SLIDE 29 @e3betht

¡ ¡

slide-30
SLIDE 30 @e3betht

¡ ¡

slide-31
SLIDE 31

@e3betht

Know ¡Your ¡Framework/Library ¡

hVps://github.com/ ¡ ¡

slide-32
SLIDE 32

@e3betht

Know ¡Your ¡Framework/Library ¡

hVps://github.com/ ¡

Contribute! ¡

slide-33
SLIDE 33

@e3betht

Checking ¡Code ¡

Sensio ¡Insight ¡ hVps://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 ¡

slide-34
SLIDE 34

@e3betht

Checking ¡Code ¡

ScruInizer ¡ hVps://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 ¡

slide-35
SLIDE 35

@e3betht

Checking ¡Code ¡

Code ¡Climate ¡ hVps://codeclimate.com/ ¡ ¡

  • Free ¡for ¡open ¡source ¡
  • Integrated ¡with ¡Git ¡
  • Very ¡fast ¡
  • Checks ¡PHP, ¡JS, ¡Ruby, ¡and ¡

coming ¡soon ¡-­‑ ¡Python ¡

  • Takes ¡security ¡seriously: ¡

codeclimate.com/security ¡ ¡

slide-36
SLIDE 36 @e3betht

¡ ¡

Never ¡ Stop ¡ Learning ¡

slide-37
SLIDE 37

@e3betht

Learn ¡by ¡Reading ¡

hVp://www.phparch.com/magazine/ ¡ ¡ ¡ ¡ hVp://www.phptherightway.com ¡ ¡ ¡ hVp://phpdeveloper.org ¡ ¡ ¡ ¡ ¡

slide-38
SLIDE 38

@e3betht

Learn ¡by ¡Reading ¡

hVps://leanpub.com ¡ ¡ ¡ Amazon ¡ ¡ Your ¡local ¡library ¡ ¡ ¡ ¡

slide-39
SLIDE 39

@e3betht

Learn ¡by ¡Watching ¡

hVp://nomadphp.com ¡ ¡ hVps://www.youtube.com/user/phpukconference ¡ hVps://www.youtube.com/user/phpacademy/ ¡ ¡ hVp://www.pluralsight.com/ ¡ hVps://www.youtube.com/user/LevelUpTuts ¡ ¡ ¡

slide-40
SLIDE 40

@e3betht

Learn ¡by ¡InstrucIon ¡

hVp://www.phparch.com/training/ ¡ ¡ hVp://www.zend.com/services/training ¡ ¡ hVp://www.codecademy.com/en/tracks/php ¡ ¡ ¡ ¡ ¡

slide-41
SLIDE 41

@e3betht

Learn ¡by ¡Listening ¡

hVp://devhell.info ¡ ¡ hVp://looselycoupled.info ¡ ¡ hVp://phptownhall.com ¡ ¡ hVp://thatpodcast.io ¡ ¡ ¡ ¡ ¡

slide-42
SLIDE 42

@e3betht

Learn ¡by ¡PracIcing ¡

hVps://laracasts.com/series/code-­‑katas-­‑in-­‑php ¡ ¡ hVp://codingdojo.org/cgi-­‑bin/index.pl? KataCatalogue ¡ ¡ hVp://phpcodepad.com ¡ ¡ ¡

slide-43
SLIDE 43

@e3betht

Learn ¡by ¡Email ¡

hVp://securingphp.com ¡ ¡ hVp://www.phpweekly.com ¡ ¡

slide-44
SLIDE 44

@e3betht

Learn ¡by ¡Hanging ¡Out ¡

Freenode ¡ ¡ hVps://webchat.freenode.net ¡ ¡ ¡ #phpc ¡ #phpwomen ¡ #phpmentoring ¡

slide-45
SLIDE 45

@e3betht

Learn ¡by… ¡

slide-46
SLIDE 46

@e3betht

Learn ¡by… ¡

Mentoring ¡

slide-47
SLIDE 47

@e3betht

Find ¡a ¡Mentor ¡

hVp://phpmentoring.org ¡ ¡ hVp://www.slideshare.net ¡ hVp://www.joind.in ¡ hVp://php.net/conferences/ ¡ hVp://nocapes.net ¡ ¡ hVp://voicesotheelephpant.com ¡ ¡ ¡ ¡

slide-48
SLIDE 48

@e3betht

Find ¡an ¡ApprenIce ¡

hVp://phpmentoring.org ¡ ¡ ¡ IRC ¡Channels ¡ Stack ¡Overflow ¡ Reddit ¡ ¡

slide-49
SLIDE 49

@e3betht

User ¡Groups ¡

hVp://php.ug ¡ ¡ hVp://php.net/cal.php ¡ ¡ hVp://www.meetup.com ¡

slide-50
SLIDE 50

@e3betht

User ¡Groups ¡

If ¡there's ¡not ¡one ¡near ¡you, ¡ start ¡one! ¡

¡ (and ¡ask ¡me ¡to ¡help) ¡ ¡

slide-51
SLIDE 51

@e3betht

Speak! ¡

hVp://rosstuck.com/Ips-­‑on-­‑speaking/ ¡ ¡ hVp://maVhewturland.com/2014/07/15/speaking-­‑ resources/ ¡ ¡ hVp://afilina.com/re-­‑how-­‑to-­‑submit-­‑to-­‑conf/ ¡ ¡ hVp://www.aliVleoxoth.com/2014/01/how-­‑to-­‑ submit-­‑a-­‑talk-­‑to-­‑a-­‑conference/ ¡ ¡ ¡ ¡

slide-52
SLIDE 52

@e3betht

Speak! ¡

hVp://php.net/conferences ¡ ¡ hVp://joind.in/event/callforpapers ¡ ¡ hVps://twiVer.com/callbackwomen ¡ ¡ ¡ ¡

slide-53
SLIDE 53 @e3betht

¡ ¡

Resources ¡ ¡

  • hVp://teamtreehouse.com/library/standards-­‑and-­‑best-­‑

pracIces ¡

  • hVp://code.tutsplus.com/tutorials/30-­‑php-­‑best-­‑pracIces-­‑for-­‑

beginners-­‑-­‑net-­‑6194 ¡

  • hVps://www.airpair.com/php/posts/best-­‑pracIces-­‑for-­‑

modern-­‑php-­‑development ¡

  • hVps://phpbestpracIces.org/ ¡
  • hVps://www.corephp.com/blog/php-­‑best-­‑pracIces-­‑that-­‑you-­‑

must-­‑follow/ ¡

  • hVp://www.phpbuilder.com/arIcles/applicaIon-­‑architecture/
  • pImizaIon/explore-­‑the-­‑top-­‑11-­‑php-­‑best-­‑pracIces.html ¡
  • hVp://pear.php.net/manual/en/standards.bestpracIces.php ¡
  • hVp://www.sitepoint.com/php-­‑Ips-­‑resources-­‑best-­‑

pracIces-­‑2015/ ¡

slide-54
SLIDE 54 @e3betht

¡ ¡ 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 ¡

¡ ¡

slide-55
SLIDE 55

@e3betht

Find ¡Me ¡

  • TwiVer: ¡e3betht ¡

¡

  • Madison ¡PHP ¡User ¡Group ¡(Meetup) ¡ ¡

hVp://www.madisonphp.com ¡ ¡ ¡

  • Slides ¡Available ¡on: ¡

hVp://www.TreelineDesign.com/slides ¡ ¡

slide-56
SLIDE 56

@e3betht

Feedback ¡

hVps://joind.in/13386 ¡ ¡ ¡ ¡ ¡ E-­‑mail: ¡ Beth@CodeClimate.com ¡ ¡