Successfully reported this slideshow.

Programming and Minimalism: Lessons from Orwell and the Clash

3

Share

Upcoming SlideShare
My media diary powerpoint
My media diary powerpoint
Loading in …3
×
1 of 156
1 of 156

Programming and Minimalism: Lessons from Orwell and the Clash

3

Share

Programming is writing. A programmer's job is to express abstract ideas in a specific language - just like the poet, the essayist, and the composer. But while writers and composers spend years improving their style, many programmers think style stops with "two-space indentation". This needs to change.

This presentation will discuss style in music, writing, and software. We'll look at such diverse sources as George Orwell, Mozart, and punk music, and will find that much of art revolves around complexity and minimalism - just like software. Finally, we'll look at specific patterns and tools for writing software that is not just effective and efficient, but stylistically beautiful.

Programming is writing. A programmer's job is to express abstract ideas in a specific language - just like the poet, the essayist, and the composer. But while writers and composers spend years improving their style, many programmers think style stops with "two-space indentation". This needs to change.

This presentation will discuss style in music, writing, and software. We'll look at such diverse sources as George Orwell, Mozart, and punk music, and will find that much of art revolves around complexity and minimalism - just like software. Finally, we'll look at specific patterns and tools for writing software that is not just effective and efficient, but stylistically beautiful.

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Related Audiobooks

Free with a 14 day trial from Scribd

See all

Programming and Minimalism: Lessons from Orwell and the Clash

  1. 1. Programming and Minimalism Jon Dahl @jondahl jon@zencoder.com Monday, March 14, 2011
  2. 2. Monday, March 14, 2011
  3. 3. http://zencoder.com/jobs Monday, March 14, 2011
  4. 4. What is good programming? Monday, March 14, 2011
  5. 5. What is programming? Monday, March 14, 2011
  6. 6. Process Monday, March 14, 2011
  7. 7. Doing shit Monday, March 14, 2011
  8. 8. Defining complex processes Monday, March 14, 2011
  9. 9. Monday, March 14, 2011
  10. 10. Monday, March 14, 2011
  11. 11. Monday, March 14, 2011
  12. 12. Monday, March 14, 2011
  13. 13. Programming is like... Monday, March 14, 2011
  14. 14. Engineering http://www.flickr.com/photos/seattlemunicipalarchives/4818952324/ Monday, March 14, 2011
  15. 15. Monday, March 14, 2011
  16. 16. Monday, March 14, 2011
  17. 17. nouns verbs Monday, March 14, 2011
  18. 18. Monday, March 14, 2011
  19. 19. Craft Monday, March 14, 2011
  20. 20. Monday, March 14, 2011
  21. 21. Tools Monday, March 14, 2011
  22. 22. Skill Monday, March 14, 2011
  23. 23. Small teams Monday, March 14, 2011
  24. 24. Habits and practices Monday, March 14, 2011
  25. 25. Writing Monday, March 14, 2011
  26. 26. Defining complex processes Monday, March 14, 2011
  27. 27. http://www.flickr.com/photos/seattlemunicipalarchives/4818952324/ Monday, March 14, 2011
  28. 28. Monday, March 14, 2011
  29. 29. Monday, March 14, 2011
  30. 30. Monday, March 14, 2011
  31. 31. Monday, March 14, 2011
  32. 32. Monday, March 14, 2011
  33. 33. Monday, March 14, 2011
  34. 34. Monday, March 14, 2011
  35. 35. Monday, March 14, 2011
  36. 36. Fire! Monday, March 14, 2011
  37. 37. Monday, March 14, 2011
  38. 38. What is good programming? Monday, March 14, 2011
  39. 39. Simple and interesting. Monday, March 14, 2011
  40. 40. Simple and interesting. Build on it. Monday, March 14, 2011
  41. 41. Simple and interesting. Build on it. Build on it. Monday, March 14, 2011
  42. 42. Simple and interesting. Build on it. Build on it. Build on it. Monday, March 14, 2011
  43. 43. Simple and interesting. Build on it. Build on it. Build on it. Build on it. Monday, March 14, 2011
  44. 44. Simple and interesting. Build on it. Build on it. Build on it. Build on it. Build on it. Monday, March 14, 2011
  45. 45. Simple and interesting. Build on it. Build on it. Build on it. Build on it. Build on it. Enormous, stale, and boring. Monday, March 14, 2011
  46. 46. Monday, March 14, 2011
  47. 47. Simple and interesting. loop { Build on it. } Enormous, stale, and boring. Start over, but retain the best parts. Monday, March 14, 2011
  48. 48. Bach Monday, March 14, 2011
  49. 49. Bach Monday, March 14, 2011
  50. 50. Bach Monday, March 14, 2011
  51. 51. Haydn Monday, March 14, 2011
  52. 52. Mozart Monday, March 14, 2011
  53. 53. Mozart Monday, March 14, 2011
  54. 54. Mozart Monday, March 14, 2011
  55. 55. Beethoven Monday, March 14, 2011
  56. 56. Beethoven Monday, March 14, 2011
  57. 57. Beethoven Monday, March 14, 2011
  58. 58. Monday, March 14, 2011
  59. 59. Mahler Monday, March 14, 2011
  60. 60. Mahler Monday, March 14, 2011
  61. 61. Mahler Monday, March 14, 2011
  62. 62. simplicity and complexity Monday, March 14, 2011
  63. 63. test tone Monday, March 14, 2011
  64. 64. white noise Monday, March 14, 2011
  65. 65. white noise Monday, March 14, 2011
  66. 66. Steve Reich Monday, March 14, 2011
  67. 67. Arvo Pärt Monday, March 14, 2011
  68. 68. Philip Glass Monday, March 14, 2011
  69. 69. minimalism Monday, March 14, 2011
  70. 70. Monday, March 14, 2011
  71. 71. Monday, March 14, 2011
  72. 72. Monday, March 14, 2011
  73. 73. Monday, March 14, 2011
  74. 74. Monday, March 14, 2011
  75. 75. Monday, March 14, 2011
  76. 76. Monday, March 14, 2011
  77. 77. Monday, March 14, 2011
  78. 78. Monday, March 14, 2011
  79. 79. Monday, March 14, 2011
  80. 80. Monday, March 14, 2011
  81. 81. Monday, March 14, 2011
  82. 82. Monday, March 14, 2011
  83. 83. Monday, March 14, 2011
  84. 84. Monday, March 14, 2011
  85. 85. Monday, March 14, 2011
  86. 86. Monday, March 14, 2011
  87. 87. Monday, March 14, 2011
  88. 88. Monday, March 14, 2011
  89. 89. simplicity and complexity Monday, March 14, 2011
  90. 90. minimalism Monday, March 14, 2011
  91. 91. Monday, March 14, 2011
  92. 92. Monday, March 14, 2011
  93. 93. USA Patriot Act Monday, March 14, 2011
  94. 94. Expanded Surveillance Act Monday, March 14, 2011
  95. 95. Propaganda Monday, March 14, 2011
  96. 96. While freely conceding that the Soviet regime exhibits certain features which the humanitarian may be inclined to deplore, we must, I think, agree that a certain curtailment of the right to political opposition is an unavoidable concomitant of transitional periods, and that the rigors which the Russian people have been called upon to undergo have been amply justified in the sphere of concrete achievement. Monday, March 14, 2011
  97. 97. I am not, indeed, sure whether it is not true to say that the Milton who once seemed not unlike a seventeenth-century Shelley had not become, out of an experience ever more bitter in each year, more alien to the founder of that Jesuit sect which nothing could induce him to tolerate. Harold Laski, Essay in Freedom of Expression Monday, March 14, 2011
  98. 98. I am not, indeed, sure whether it is not true to say that the Milton who once seemed not unlike a seventeenth-century Shelley had not become, out of an experience ever more bitter in each year, more alien to the founder of that Jesuit sect which nothing could induce him to tolerate. Monday, March 14, 2011
  99. 99. I am not, indeed, sure whether it is not true to say that the Milton who once seemed not unlike a seventeenth-century Shelley had not become, out of an experience ever more bitter in each year, more alien to the founder of that Jesuit sect which nothing could induce him to tolerate. Monday, March 14, 2011
  100. 100. 1. Never use a metaphor, simile, or other figure of speech which you are used to seeing in print. Monday, March 14, 2011
  101. 101. 2. Never use a long word where a short one will do. Monday, March 14, 2011
  102. 102. 3. If it is possible to cut a word out, always cut it out. Monday, March 14, 2011
  103. 103. 4. Never use the passive where you can use the active. Monday, March 14, 2011
  104. 104. 5. Never use a foreign phrase, a scientific word, or a jargon word if you can think of an everyday English equivalent. Monday, March 14, 2011
  105. 105. 6. Break any of these rules sooner than say anything outright barbarous. Monday, March 14, 2011
  106. 106. clear writing ➡ clear thinking Monday, March 14, 2011
  107. 107. bad writing ➡ bad thinking Monday, March 14, 2011
  108. 108. bad writing ➡ bad thinking ➡ totalitarianism Monday, March 14, 2011
  109. 109. What is good programming? Monday, March 14, 2011
  110. 110. minimalism Monday, March 14, 2011
  111. 111. Defining complex processes Monday, March 14, 2011
  112. 112. minimalism Monday, March 14, 2011
  113. 113. clear, direct writing Monday, March 14, 2011
  114. 114. 1. Always take the simplest approach to a problem. Monday, March 14, 2011
  115. 115. 2. Clever code is bad code. Monday, March 14, 2011
  116. 116. module ApplicationHelper def me?(user=@user) returning(user == current_user) do |me| yield if me && block_given? end end end Monday, March 14, 2011
  117. 117. <% me?(@user) do %> <p><%= @user.private_info %></p> <% end %> Monday, March 14, 2011
  118. 118. module ApplicationHelper def me?(user=@user) returning(user == current_user) do |me| yield if me && block_given? end end end Monday, March 14, 2011
  119. 119. module ApplicationHelper def me?(user) yield if user == current_user end end Monday, March 14, 2011
  120. 120. 3. Any code that isn’t doing something is harming your project. Monday, March 14, 2011
  121. 121. 4. Accept constraints. Monday, March 14, 2011
  122. 122. 5. If it isn’t local business logic, it should be a library. Monday, March 14, 2011
  123. 123. view -> controller -> model Monday, March 14, 2011
  124. 124. model -> library -> open library Monday, March 14, 2011
  125. 125. 6. Don’t over-abstract. Monday, March 14, 2011
  126. 126. @user.groups.map(&:name).to_sentence Monday, March 14, 2011
  127. 127. class User def group_list group_names = groups.map do |group| group.name end group_names.to_sentence end end Monday, March 14, 2011
  128. 128. admin_roles.include?(@user.role) ? @user.groups.map {|g| g.name }.sort_by(&:name).to_sentence : @user.groups.select {|g| g.public? }.map {|g| g.name }.sort_by(&:name).to_sentence Monday, March 14, 2011
  129. 129. 7. Always actively clean up. Constantly. Monday, March 14, 2011
  130. 130. map.connect ':controller/:action/:id.:format' has_and_belongs_to_many :roles start_form_tag activate_users_url Monday, March 14, 2011
  131. 131. Monday, March 14, 2011
  132. 132. 8. Apply these rules wisely. Monday, March 14, 2011
  133. 133. 9. Simple code is beautiful. Monday, March 14, 2011
  134. 134. 10. Break hard problems down. Monday, March 14, 2011
  135. 135. Defining complex processes Monday, March 14, 2011
  136. 136. http://www.flickr.com/photos/seattlemunicipalarchives/4818952324/ Monday, March 14, 2011
  137. 137. Monday, March 14, 2011
  138. 138. Monday, March 14, 2011
  139. 139. flight.book_flight_for(customer) Monday, March 14, 2011
  140. 140. def book_flight_for(customer) reserve_flight_for(customer) customer.charge(cost) customer.notify(details) end Monday, March 14, 2011
  141. 141. def reserve_flight_for(customer) if flight.available? mark_flight_reserved_for(customer) end end Monday, March 14, 2011
  142. 142. def charge(cost) ... end Monday, March 14, 2011
  143. 143. def notify(details) ... end Monday, March 14, 2011
  144. 144. 10. Break hard problems down. Monday, March 14, 2011
  145. 145. Consume Monday, March 14, 2011
  146. 146. Study Monday, March 14, 2011
  147. 147. Produce Monday, March 14, 2011
  148. 148. you have a programming style Monday, March 14, 2011
  149. 149. make it better Monday, March 14, 2011
  150. 150. minimal Monday, March 14, 2011
  151. 151. clear Monday, March 14, 2011
  152. 152. direct Monday, March 14, 2011
  153. 153. effective Monday, March 14, 2011
  154. 154. beautiful Monday, March 14, 2011
  155. 155. write beautiful code Monday, March 14, 2011
  156. 156. Jon Dahl @jondahl jon@zencoder.com Monday, March 14, 2011

×