Programming and Minimalism                                         Jon Dahl                                         @jonda...
Monday, March 14, 2011
http://zencoder.com/jobsMonday, March 14, 2011
What is                 good programming?Monday, March 14, 2011
What is                         programming?Monday, March 14, 2011
ProcessMonday, March 14, 2011
Doing shitMonday, March 14, 2011
Defining                         complex processesMonday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Programming                               is like...Monday, March 14, 2011
Engineering                         http://www.flickr.com/photos/seattlemunicipalarchives/4818952324/Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
nouns       verbsMonday, March 14, 2011
Monday, March 14, 2011
CraftMonday, March 14, 2011
Monday, March 14, 2011
ToolsMonday, March 14, 2011
SkillMonday, March 14, 2011
Small teamsMonday, March 14, 2011
Habits                         and practicesMonday, March 14, 2011
WritingMonday, March 14, 2011
Defining                         complex processesMonday, March 14, 2011
http://www.flickr.com/photos/seattlemunicipalarchives/4818952324/Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Fire!Monday, March 14, 2011
Monday, March 14, 2011
What is                 good programming?Monday, March 14, 2011
Simple and interesting.Monday, March 14, 2011
Simple and interesting.               Build on it.Monday, March 14, 2011
Simple and interesting.               Build on it.               Build on it.Monday, March 14, 2011
Simple and interesting.               Build on it.               Build on it.               Build on it.Monday, March 14, ...
Simple and interesting.               Build on it.               Build on it.               Build on it.               Bui...
Simple and interesting.               Build on it.               Build on it.               Build on it.               Bui...
Simple and interesting.               Build on it.               Build on it.               Build on it.               Bui...
Monday, March 14, 2011
Simple and interesting.               loop { Build on it. }               Enormous, stale, and boring.               Start...
BachMonday, March 14, 2011
BachMonday, March 14, 2011
BachMonday, March 14, 2011
HaydnMonday, March 14, 2011
MozartMonday, March 14, 2011
MozartMonday, March 14, 2011
MozartMonday, March 14, 2011
BeethovenMonday, March 14, 2011
BeethovenMonday, March 14, 2011
BeethovenMonday, March 14, 2011
Monday, March 14, 2011
MahlerMonday, March 14, 2011
MahlerMonday, March 14, 2011
MahlerMonday, March 14, 2011
simplicity                         and complexityMonday, March 14, 2011
test toneMonday, March 14, 2011
white noiseMonday, March 14, 2011
white noiseMonday, March 14, 2011
Steve ReichMonday, March 14, 2011
Arvo                         PärtMonday, March 14, 2011
Philip GlassMonday, March 14, 2011
minimalismMonday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
simplicity                         and complexityMonday, March 14, 2011
minimalismMonday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
USA Patriot ActMonday, March 14, 2011
Expanded                         Surveillance ActMonday, March 14, 2011
PropagandaMonday, March 14, 2011
While freely conceding that the Soviet         regime exhibits certain features which         the humanitarian may be incl...
I am not, indeed, sure whether it is not         true to say that the Milton who once         seemed not unlike a seventee...
I am not, indeed, sure whether it is not         true to say that the Milton who once         seemed not unlike a seventee...
I am not, indeed, sure whether it is not         true to say that the Milton who once         seemed not unlike a seventee...
1. Never use a metaphor, simile, or               other figure of speech which you               are used to seeing in prin...
2. Never use a long word where a               short one will do.Monday, March 14, 2011
3. If it is possible to cut a word               out, always cut it out.Monday, March 14, 2011
4. Never use the passive where               you can use the active.Monday, March 14, 2011
5. Never use a foreign phrase, a               scientific word, or a jargon word if               you can think of an every...
6. Break any of these rules sooner               than say anything outright               barbarous.Monday, March 14, 2011
clear writing ➡ clear thinkingMonday, March 14, 2011
bad writing ➡ bad thinkingMonday, March 14, 2011
bad writing ➡ bad thinking       ➡ totalitarianismMonday, March 14, 2011
What is                 good programming?Monday, March 14, 2011
minimalismMonday, March 14, 2011
Defining                         complex processesMonday, March 14, 2011
minimalismMonday, March 14, 2011
clear,                         direct writingMonday, March 14, 2011
1. Always take the simplest approach               to a problem.Monday, March 14, 2011
2. Clever code is bad code.Monday, March 14, 2011
module ApplicationHelper        def me?(user=@user)          returning(user == current_user) do |me|            yield if m...
<% me?(@user) do %>                           <p><%= @user.private_info %></p>                         <% end %>Monday, Ma...
module ApplicationHelper        def me?(user=@user)          returning(user == current_user) do |me|            yield if m...
module ApplicationHelper         def me?(user)           yield if user == current_user         end       endMonday, March ...
3. Any code that isn’t doing               something is harming your project.Monday, March 14, 2011
4. Accept constraints.Monday, March 14, 2011
5. If it isn’t local business logic, it               should be a library.Monday, March 14, 2011
view -> controller -> modelMonday, March 14, 2011
model -> library -> open libraryMonday, March 14, 2011
6. Don’t over-abstract.Monday, March 14, 2011
@user.groups.map(&:name).to_sentenceMonday, March 14, 2011
class User             def group_list               group_names = groups.map do |group|                 group.name        ...
admin_roles.include?(@user.role) ? @user.groups.map {|g|g.name }.sort_by(&:name).to_sentence : @user.groups.select {|g|g.p...
7. Always actively clean up.               Constantly.Monday, March 14, 2011
map.connect :controller/:action/:id.:format  has_and_belongs_to_many :roles  start_form_tag activate_users_urlMonday, Marc...
Monday, March 14, 2011
8. Apply these rules wisely.Monday, March 14, 2011
9. Simple code is beautiful.Monday, March 14, 2011
10. Break hard problems down.Monday, March 14, 2011
Defining                         complex processesMonday, March 14, 2011
http://www.flickr.com/photos/seattlemunicipalarchives/4818952324/Monday, March 14, 2011
Monday, March 14, 2011
Monday, March 14, 2011
flight.book_flight_for(customer)Monday, March 14, 2011
def book_flight_for(customer)     reserve_flight_for(customer)     customer.charge(cost)     customer.notify(details)   en...
def reserve_flight_for(customer)     if flight.available?       mark_flight_reserved_for(customer)     end   endMonday, Ma...
def charge(cost)     ...   endMonday, March 14, 2011
def notify(details)     ...   endMonday, March 14, 2011
10. Break hard problems down.Monday, March 14, 2011
ConsumeMonday, March 14, 2011
StudyMonday, March 14, 2011
ProduceMonday, March 14, 2011
you have a                         programming styleMonday, March 14, 2011
make it betterMonday, March 14, 2011
minimalMonday, March 14, 2011
clearMonday, March 14, 2011
directMonday, March 14, 2011
effectiveMonday, March 14, 2011
beautifulMonday, March 14, 2011
write beautiful codeMonday, March 14, 2011
Jon Dahl                                 @jondahl                         jon@zencoder.comMonday, March 14, 2011
Upcoming SlideShare
Loading in...5
×

Programming and Minimalism: Lessons from Orwell and the Clash

2,468

Published on

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.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,468
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Programming and Minimalism: Lessons from Orwell and the Clash

  1. 1. Programming and Minimalism Jon Dahl @jondahl jon@zencoder.comMonday, March 14, 2011
  2. 2. Monday, March 14, 2011
  3. 3. http://zencoder.com/jobsMonday, March 14, 2011
  4. 4. What is good programming?Monday, March 14, 2011
  5. 5. What is programming?Monday, March 14, 2011
  6. 6. ProcessMonday, March 14, 2011
  7. 7. Doing shitMonday, March 14, 2011
  8. 8. Defining complex processesMonday, 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 verbsMonday, March 14, 2011
  18. 18. Monday, March 14, 2011
  19. 19. CraftMonday, March 14, 2011
  20. 20. Monday, March 14, 2011
  21. 21. ToolsMonday, March 14, 2011
  22. 22. SkillMonday, March 14, 2011
  23. 23. Small teamsMonday, March 14, 2011
  24. 24. Habits and practicesMonday, March 14, 2011
  25. 25. WritingMonday, March 14, 2011
  26. 26. Defining complex processesMonday, 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. BachMonday, March 14, 2011
  49. 49. BachMonday, March 14, 2011
  50. 50. BachMonday, March 14, 2011
  51. 51. HaydnMonday, March 14, 2011
  52. 52. MozartMonday, March 14, 2011
  53. 53. MozartMonday, March 14, 2011
  54. 54. MozartMonday, March 14, 2011
  55. 55. BeethovenMonday, March 14, 2011
  56. 56. BeethovenMonday, March 14, 2011
  57. 57. BeethovenMonday, March 14, 2011
  58. 58. Monday, March 14, 2011
  59. 59. MahlerMonday, March 14, 2011
  60. 60. MahlerMonday, March 14, 2011
  61. 61. MahlerMonday, March 14, 2011
  62. 62. simplicity and complexityMonday, March 14, 2011
  63. 63. test toneMonday, March 14, 2011
  64. 64. white noiseMonday, March 14, 2011
  65. 65. white noiseMonday, March 14, 2011
  66. 66. Steve ReichMonday, March 14, 2011
  67. 67. Arvo PärtMonday, March 14, 2011
  68. 68. Philip GlassMonday, March 14, 2011
  69. 69. minimalismMonday, 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 complexityMonday, March 14, 2011
  90. 90. minimalismMonday, March 14, 2011
  91. 91. Monday, March 14, 2011
  92. 92. Monday, March 14, 2011
  93. 93. USA Patriot ActMonday, March 14, 2011
  94. 94. Expanded Surveillance ActMonday, March 14, 2011
  95. 95. PropagandaMonday, 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 ExpressionMonday, 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 thinkingMonday, March 14, 2011
  107. 107. bad writing ➡ bad thinkingMonday, March 14, 2011
  108. 108. bad writing ➡ bad thinking ➡ totalitarianismMonday, March 14, 2011
  109. 109. What is good programming?Monday, March 14, 2011
  110. 110. minimalismMonday, March 14, 2011
  111. 111. Defining complex processesMonday, March 14, 2011
  112. 112. minimalismMonday, March 14, 2011
  113. 113. clear, direct writingMonday, 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 endMonday, 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 endMonday, March 14, 2011
  119. 119. module ApplicationHelper def me?(user) yield if user == current_user end endMonday, 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 -> modelMonday, March 14, 2011
  124. 124. model -> library -> open libraryMonday, March 14, 2011
  125. 125. 6. Don’t over-abstract.Monday, March 14, 2011
  126. 126. @user.groups.map(&:name).to_sentenceMonday, March 14, 2011
  127. 127. class User def group_list group_names = groups.map do |group| group.name end group_names.to_sentence end endMonday, 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_sentenceMonday, 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_urlMonday, 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 processesMonday, 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) endMonday, March 14, 2011
  141. 141. def reserve_flight_for(customer) if flight.available? mark_flight_reserved_for(customer) end endMonday, March 14, 2011
  142. 142. def charge(cost) ... endMonday, March 14, 2011
  143. 143. def notify(details) ... endMonday, March 14, 2011
  144. 144. 10. Break hard problems down.Monday, March 14, 2011
  145. 145. ConsumeMonday, March 14, 2011
  146. 146. StudyMonday, March 14, 2011
  147. 147. ProduceMonday, March 14, 2011
  148. 148. you have a programming styleMonday, March 14, 2011
  149. 149. make it betterMonday, March 14, 2011
  150. 150. minimalMonday, March 14, 2011
  151. 151. clearMonday, March 14, 2011
  152. 152. directMonday, March 14, 2011
  153. 153. effectiveMonday, March 14, 2011
  154. 154. beautifulMonday, March 14, 2011
  155. 155. write beautiful codeMonday, March 14, 2011
  156. 156. Jon Dahl @jondahl jon@zencoder.comMonday, March 14, 2011

×