Writing code you won't hate tomorrow

download Writing code you won't hate tomorrow

If you can't read please download the document

Transcript of Writing code you won't hate tomorrow

  1. 1. Writing codethat lasts.Rafael Dohms@rdohmsphoto: djandyw.com
  2. 2. Writing codeyou wont hate tomorrow.Rafael Dohms@rdohmsphoto: djandyw.com
  3. 3. Let meintroduceyou tosomeone
  4. 4. No Tests.shhh.. dont tell Grumpy.Wrote his own framework... and used it.Used Singletons!.. and every other anti-pattern out there.500 line methods. not even methods, they were functions
  5. 5. photo: Rob Allen (@akrabat)
  6. 6. REWRITEALL THE CODE!
  7. 7. photo: Glyn Lowe PhotoworksReal Developers,SHIP STUFF.
  8. 8. How do we findbalance?photo: Kalexanderson
  9. 9. Code has anexpiration datephoto: CarbonNYC
  10. 10. Code isphoto by: massdistractionperishable, it rots.
  11. 11. Code Evolvesphoto by: kevin dooley
  12. 12. Languages evolve.photo by: raneko
  13. 13. You evolve.photo by: Kaptain Kobold
  14. 14. ComplexitykillsComprehensionphoto: osbornb
  15. 15. Bad Designphoto: miskan
  16. 16. Bad specs
  17. 17. NIHphoto by: John 'K'source: Urban dictionary
  18. 18. NIH| nt nventd h |Not Invented Here The German art of humiliating any technology,agricultural product, or (medical) scientific work that has not beeninvented or produced in Germany, Switzerland, or Austria.photo by: John 'K'source: Urban dictionary
  19. 19. The Solutionphoto: Ian Sane
  20. 20. Improve code
  21. 21. make it easier to comprehendImprove code
  22. 22. make it easier to comprehendmake it flexibleImprove code
  23. 23. make it easier to comprehendmake it flexiblemake it testedImprove code
  24. 24. make it easier to comprehendmake it flexiblemake it testedImprove codemake it easier to replace, refactor
  25. 25. make it easier to comprehendmake it flexiblemake it testedImprove codemake it easier to replace, refactormake it not exist
  26. 26. Testingphoto by: jeffkrause
  27. 27. Good DesignConcepts
  28. 28. SOLIDSingle ResponsibilityOpen and CloseLiskov substitutionInterface SegregationDependency Inversionphoto by j_regan
  29. 29. photo by lofinkSTUPIDSingletonTight CouplingUntestabilityPremature OptimizationIndescriptive NamingDuplication
  30. 30. photo by halloweenstockDesign Patterns
  31. 31. Composer
  32. 32. PIEProudlyInventedElsewhere
  33. 33. guzzle/guzzleHTTP client for RESTful API clientsphoto by j_regan
  34. 34. morrisonlevi/ardentA library of collections for PHP
  35. 35. Readabilityphoto: Morgenland
  36. 36. paragraphsphoto: Trossachs Photography
  37. 37. whitespace
  38. 38. Cape Town So PauloR&D Team for MIH/Naspers
  39. 39. ObjectCalisthenicsphoto by: boston_public_library
  40. 40. Calisthenics/kalsTHeniks/Calisthenics are a form of dynamic exercise consisting of a variety ofsimple, often rhythmical, movements, generally using minimalequipment or apparatus.photo by: boston_public_library
  41. 41. Its about perception,not rules or standards photo by: david_a_l
  42. 42. #1Only oneindentation levelper method.photo by: justinliew
  43. 43. #2Do notuse elsephoto by: justinliew
  44. 44. #3Wrap primitivetypes, if theycontain behaviorphoto by: justinliew
  45. 45. #4Only one-> per linephoto by: justinliew
  46. 46. #5Do notabbreviate.photo by: justinliew
  47. 47. #6Keep yourclasses small.photo by: justinliew
  48. 48. #7Limit yourinstance variablesto less then 5photo by: justinliew
  49. 49. #8Use first classcollectionsphoto by: justinliew
  50. 50. #9Use gettersand setters.photo by: justinliew
  51. 51. #10Documentyour code.photo by: justinliew
  52. 52. Your turn.
  53. 53. Improveyourself!
  54. 54. Read lots ofcode!
  55. 55. Write simplecode.
  56. 56. Try Object Calisthenicsfor a month.
  57. 57. Use someoneelses code.
  58. 58. Share bite sizelibraries.
  59. 59. Thank you.@rdohmshttps://joind.in/12734http://doh.mshttp://slides.doh.msplease rate me!
  60. 60. http://l.doh.ms/oc-linksVideo recordingSlidesBooksResources onObject Calisthenics