Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Why every developer should read Plato

2.869 Aufrufe

Veröffentlicht am

Let's do some Socratic questioning! In this talk I inquire into what makes WordPress the highly successful platform that it is. I end up inquiring the filter API WordPress has in place that makes it easy to filter data and investigate potential problems. In doing so, I try to make a case for adding some philosophical literature to your development resources!

Veröffentlicht in: Software
  • Als Erste(r) kommentieren

Why every developer should read Plato

  1. 1. Why every developer 
 should read Plato
  2. 2. @OmarReiss CTO at Yoast Philosopher Developer Platomar
  3. 3. 26%
  4. 4. What makes WordPress a superhero?
  5. 5. WordPress makes users awesome! Source: useronboard.com
  6. 6. What makes WordPress a superhero?
  7. 7. How does WordPress turn users into superheroes?
  8. 8. We can build almost anything using WordPress
  9. 9. 47,260 plugins
  10. 10. You can write a WordPress plugin 
 with 0 lines of code.
  11. 11. What makes WordPress so easy to plugin to?
  12. 12. Filters! (and actions)
  13. 13. API add_filter remove_filter apply_filters Filters
  14. 14. A filter is a function
  15. 15. A filter is a function
  16. 16. Timing The plugins are loaded WordPress is initialised The head is rendered The content is rendered After After do_action(‘plugins_loaded’) do_action(‘init’) do_action(‘wp_head’) apply_filters(‘the content’) Before Before
  17. 17. What should we use filters for?
  18. 18. “As a site owner, I want Yoast SEO to use the excerpt as a meta description.” Usecase
  19. 19. “As a custom fields plugin builder, I want Yoast SEO to use a custom field as a meta description.” Usecase
  20. 20. “As a {ROLE}, I want Yoast SEO to use {FIELD} as a meta description.” Usecase
  21. 21. How does this translate to WordPress?
  22. 22. “As a {ROLE}, I want to be able to filter the meta description that Yoast SEO outputs.” Usecase
  23. 23. Example Example
  24. 24. What is a meta description?
  25. 25. Filter the output
  26. 26. Filter the data
  27. 27. Filtering the output
  28. 28. Filtering the data
  29. 29. Data types String -> “hello” Integer -> 123 Array -> [$a, $b, $c] etc. What is data?
  30. 30. Is “<html><body>Hello world</body></html>” a string?
  31. 31. V = f( M )
  32. 32. View = function( Model )
  33. 33. Filter data, not representation
  34. 34. Filter the data
  35. 35. Filtering the data
  36. 36. Can I safely filter data?
  37. 37. Type juggling #YO LO
  38. 38. Notice: Array to string conversion…
  39. 39. Type checking madness
  40. 40. Never trust filtered data Because #YOLO
  41. 41. Hey! But wasn’t this supposed to be easy?
  42. 42. And what does this have to do with Plato?
  43. 43. - Maieutike - Irony - Anamnesis
  44. 44. 26%
  45. 45. What makes WordPress a superhero?
  46. 46. WordPress makes users awesome! Source: useronboard.com
  47. 47. What makes WordPress a superhero?
  48. 48. How does WordPress turn users into superheroes?
  49. 49. We can build almost anything using WordPress
  50. 50. 47,260 plugins
  51. 51. You can write a WordPress plugin 
 with 0 lines of code.
  52. 52. What makes WordPress so easy to plugin to?
  53. 53. Filters! (and actions)
  54. 54. API add_filter remove_filter apply_filters Filters
  55. 55. A filter is a function What is a filter?
  56. 56. A filter is a function
  57. 57. Timing The plugins are loaded WordPress is initialised The head is rendered The content is rendered After After do_action(‘plugins_loaded’) do_action(‘init’) do_action(‘wp_head’) apply_filters(‘the content’) Before Before
  58. 58. What should we use filters for?
  59. 59. “As a site owner, I want Yoast SEO to use the excerpt as a meta description.” Usecase
  60. 60. “As a custom fields plugin builder, I want Yoast SEO to use a custom field as a meta description.” Usecase
  61. 61. “As a {ROLE}, I want Yoast SEO to use {FIELD} as a meta description.” Usecase
  62. 62. How does this translate to WordPress?
  63. 63. “As a {ROLE}, I want to be able to filter the meta description that Yoast SEO outputs.” Usecase
  64. 64. Example Example
  65. 65. What is a meta description?
  66. 66. Filter the output
  67. 67. Filter the data
  68. 68. Filtering the output
  69. 69. Filtering the data
  70. 70. Data types String -> “hello” Integer -> 123 Array -> [$a, $b, $c] etc. What is data?
  71. 71. Is “<html><body>Hello world</body></html>” a string?
  72. 72. V = f( M )
  73. 73. View = function( Model )
  74. 74. Filter data, not representation
  75. 75. Filter the data
  76. 76. Filtering the data
  77. 77. Can I safely filter data?
  78. 78. Type juggling #YO LO
  79. 79. Notice: Array to string conversion…
  80. 80. Type checking madness
  81. 81. Never trust filtered data Because #YOLO
  82. 82. But wasn’t this supposed to be easy?
  83. 83. Issues with filters In WordPress it’s hard to distinguish representation from raw data, because of reasons. In WordPress it’s not possible to trust filtered data, because of reasons. In WordPress it’s not possible to know when a filter was applied, because of reasons. Conclusion
  84. 84. And what does this have to do with Plato?
  85. 85. Why every developer should read Plato Plato working on his art To learn about Socrates To learn about Plato To practice inquiry
  86. 86. Thank you! @OmarReiss

×