Your SlideShare is downloading. ×
Things I wish web graduates knew
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Things I wish web graduates knew

2,467
views

Published on

Slides from a talk I gave to local students studying PHP, about some key skills, open source, and the importance of learning to help themselves.

Slides from a talk I gave to local students studying PHP, about some key skills, open source, and the importance of learning to help themselves.

Published in: Technology

0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,467
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
39
Comments
0
Likes
6
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Good Practice in PHP Or "Things I Wish New Recruits Knew"
  • 2. About Me
    • Lorna Mitchell
    • 3. Twitter: @lornajane
    • 4. PHP consultant, trainer, and author
    • 5. I live in Leeds
    • 6. Website: http://lornajane.net
    • 7. Book: http://sitepoint.com/books/phppro
  • 8. Today's Outline
    • Software Development Lifecycle
    • 9. Databases
    • 10. Source Control
    • 11. Documentation
    • 12. Open Source
  • 13. Software Lifecycles
  • 14. Waterfall
  • 15. Waterfall
  • 16. Agile
    • Many different interpretations
    • 17. Some or all of:
      • iterative
      • 18. customer involvement
      • 19. product is always working
      • 20. done in bursts called "sprints"
      • 21. spec can change (in a controlled way)
  • 22. Databases
  • 23. Databases
    • Not a dumping ground
    • 24. Often your application bottleneck
    • 25. Worth understanding
  • 26. Tools
    • phpMyAdmin
      • http://phpmyadmin.net
    • Command Line
      • powerful
      • 27. well-documented
  • 28. Normalised Forms
    • Guidelines for good table design
    • 29. 1 st Normal Form
      • no repeating groups (e.g. comma separated lists)
    • 2 nd Normal Form
      • decouples entities and links them by relationship (e.g. customer data separate from order)
    • 3 rd Normal Form <- good enough!
      • removes redundancy and dependent information
  • 30. Indices
    • An index allows MySQL to quickly find things
    • 31. Foreign key contstraints
    • 32. Columns used in where clauses
  • 33. EXPLAIN
    • MySQL command
    • 34. Which indexes are used
    • 35. What kind of indexes
    • 36. Number of rows scanned
    • 37. Great for diagnosing slow queries
  • 38. Source Control
  • 39. Using Source Control
    • Create a repository, add project
    • 40. Check out project
    • 41. Make changes
    • 42. Update to get other changes
    • 43. Commit changes to repo
  • 44. svn log ------------------------------------------------------------------------ r3 | lornajane | 2010-04-25 10:32:09 +0100 (Sun, 25 Apr 2010) | 1 line adding documentation notes ------------------------------------------------------------------------ r2 | lornajane | 2010-04-22 09:07:56 +0100 (Thu, 22 Apr 2010) | 1 line outlining source control and design patterns sections ------------------------------------------------------------------------ r1 | weierophinney | 2010-03-30 17:37:27 +0100 (Tue, 30 Mar 2010) | 1 line Added readme with outline ------------------------------------------------------------------------
  • 45. svn diff Index: README.txt =================================================================== --- README.txt (revision 3) +++ README.txt (revision 4) @@ -31,12 +35,20 @@ to share ideas to raise profile to be told you're doing it wrong! + (pulling up examples off our own blogs, if connection allows) Testing (Matthew) QA tools and CI including code analysis, mess detection, etc (Lorna - QA tools; Matthew - CI) + Static analysis + code sniffer + demo examples, find a suitable small codebase (joindin?) + mess detector + demo examples + what else? + Deployment
  • 46. Source Control Tools
    • Subversion (svn)
      • http://subversion.apache.org/
    • Git (git)
      • http://git-scm.com/
    • Mercurial (hg)
      • http://mercurial.selenic.com/
  • 47. Accessing Source Control
    • IDE Plugins
    • 48. Trac ( http://trac.edgewall.org/ )
    • 49. TortoiseSVN
  • 52. Centralised Source Control user repo user user user
  • 53. Centralised Source Control
    • Single repo (repository)
    • 54. Always commit to central
    • 55. Can branch centrally
  • 56. Distributed Source Control repo repo repo repo repo
  • 57. Distributed Source Control
    • Many repos
    • 58. Commit to local repo
    • 59. Share changes between anywhere
    • 60. No central point
  • 61. What If I Don't Have Source Control?
    • Get some :)
    • 62. Install subversion
    • 63. Use a hosted solution
  • 64. Documentation
  • 65. API Docs
    • Documentation generated from source code itself
    • 66. Follows code structure
  • 70. PHPDocumentor
  • 71. PHPDocumentor
    • PHPDocumentor
      • http://www.phpdoc.org/
    • Uses reflection
    • 72. Comments for additional information
    • 73. Add descriptions to the documentation
  • 74. PHPDocumentor Comments 1 < ?php 2 3 class AttendeeList { 4 private $attendees ; 5 private $observers ; 6 7 /** 8 * Add an attendee to the list 9 * 10 * @param integer $id Attendee identifier/array index 11 * @param string $name Full name of the attendee 12 * @access public 13 * @return boolean If attendee was successfully added 14 */ 15 public function addAttendee ( $id , $name ) { 16 $this -> attendees [ $id ] = $name ; 17 $this -> notify (); 18 } 19 20 }
  • 75. Beyond API Docs
  • 81. Today's Outline
  • 86. Other Topics
    • System administration
    • 87. Maintenance and bugs
    • 88. Design patterns
  • 89. Open Source
  • 90. Open Source
    • Free software
      • Free as in beer
      • 91. Free as in freedom
    • Licensing
    • Avoid reinventing the wheel
  • 93. Open Source
    • Find excellent (free) tools
    • 94. Build excellent (free) tools
  • 95. The Local PHP Scene
    • LeedsPHP http://leedsphp.org
    • 96. PHPNW http://phpnw.org.uk
    • 97. GeekUp http://geekup.org
  • 98. The Global PHP Scene
    • Everything happens on IRC
      • try #phpc or #phpnw for starters
    • Read http://phpdeveloper.org daily
    • 99. Check out http://stackoverflow.com
    • 100. Learn to help yourself!
  • 101. Questions?