The World Runs on Bad Software

The World Runs on Bad Software

20bfe76b3d6105641f879fe45cfc9272?s=128

Brandon Keepers

August 12, 2011
Tweet

Transcript

  1. Brandon Keepers Lone Star Ruby Conference V August 12, 2011

    BAD the world runs on software Ordered List
  2. None
  3. @bkeepers I

  4. opensoul.org I

  5. None
  6. group therapy

  7. None
  8. None
  9. pride

  10. craftsman

  11. art

  12. I

  13. get.harmonyapp.com

  14. get.gaug.es

  15. speakerdeck.com

  16. None
  17. I — GOOD CODE!

  18. not perfect

  19. :(

  20. HAS NOT IMPLODED

  21. HAS NOT IMPLODED yet ^

  22. RUNS

  23. in spite of

  24. because of

  25. bad software

  26. pragmatism perfection

  27. What is good software? How does it go bad? How

    do we build better software?
  28. good software

  29. “ Good software meets the present objective at an acceptable

    cost without incurring an unacceptable amount of future risk.
  30. adequacy

  31. !mediocrity

  32. objective

  33. software != code

  34. “ Zach Dennis Mutually Human Software People fail to realize

    that quality is merely a property of the code that exists, not the reason for its existence.
  35. users don’t care

  36. “ Scott Berkun We’re frustrated most in life by things

    that come close to our deepest needs, but don’t deliver.
  37. cost

  38. “ Ray Yeargin Virtually all of the cost of software

    development is, directly and indirectly, the cost of design.
  39. Production almost zero of

  40. $$$$

  41. $$$

  42. $$

  43. $

  44. None
  45. risk

  46. !science

  47. ‑Risk ‐Cost

  48. What is good software? How does it go bad? How

    do we build better software?
  49. entropy

  50. “ The Pragmatic Programmer While software development is immune from

    almost all physical laws, entropy hits us hard.
  51. why?

  52. software is malleable

  53. None
  54. software is complex

  55. rake stats

  56. 2.5 million parts

  57. None
  58. software is immature

  59. None
  60. software is opaque

  61. software is durable

  62. None
  63. What is good software? How does it go bad? How

    do we build better software?
  64. better software? how do we build

  65. talk to your users

  66. automated testing

  67. insurance policy

  68. automation computers are good at

  69. None
  70. DRY

  71. None
  72. refactoring small, incremental

  73. What is good software? How does it go bad? How

    do we build better software?
  74. Examples

  75. method_missing

  76. class NilClass def method_missing(method, *args) nil end end

  77. >> nil.foo.bar => nil >> nil + 5 => nil

    >> 5 + nil TypeError: coerce must return [x, y]
  78. None
  79. performance maintenance

  80. def to_xml(options={}) root_tag = options.fetch(:root, 'game') instruct = options[:skip_instruct] ?

    '' : XML_INSTRUCT # … # gather up a bunch of variables # … <<-EOF #{instruct} <#{root_tag}> <id>#{id}</id> <current-move-user-id>#{current_move_user_id}</ current-move-user-id> <created-by-user-id>#{created_by_user_id}</ created-by-user-id> <chat_session_id>0</chat_session_id> <is-matchmaking>#{is_matchmaking}</is-matchmaking> <was-matchmaking>#{was_matchmaking}</was- matchmaking> <moves-count>#{moves_count}</moves-count> <random-seed>#{random_seed}</random-seed>
  81. #{instruct} <#{root_tag}> <id>#{id}</id> <current-move-user-id>#{current_move_user_id}</ current-move-user-id> <created-by-user-id>#{created_by_user_id}</ created-by-user-id> <chat_session_id>0</chat_session_id> <is-matchmaking>#{is_matchmaking}</is-matchmaking> <was-matchmaking>#{was_matchmaking}</was-

    matchmaking> <moves-count>#{moves_count}</moves-count> <random-seed>#{random_seed}</random-seed> <client-version>#{client_version}</client-version> <created-at>#{created_at.try(:xmlschema)}</ created-at> <users type="array">#{users_xml}</users> #{current_user_xml} #{moves_xml} #{chats_xml} </#{root_tag}> EOF end
  82. commit fa779d9c2d1214e43ff497f386b51ebf3708346e Author: Brandon Keepers <brandon@collectiveidea.com> Date: Wed Sep 22

    17:08:38 2010 -0400 First attempt at getting embedded callbacks working
  83. def create_or_update run_callbacks(:before_save) if result = super run_callbacks(:after_save) end result

    end Rails 2
  84. def create_or_update run_callbacks(:save) { super } end Rails 3

  85. def run_callbacks(kind, options={}, &block) self.embedded_associations.each do |association| self.send(association.name).run_callbacks( kind, options,

    &block ) end end
  86. def run_callbacks(callback, &block) embedded_docs = [] embedded_associations.each do |association| embedded_docs

    += association.target end block = embedded_docs.inject(block) do |chain, doc| if doc.class.respond_to?("_#{callback}_callbacks") lambda { doc.run_callbacks(callback, &chain) } else chain end end super callback, &block end
  87. SystemStackError: stack level too deep from mongo_mapper/plugins/embedded_callbacks.rb:23:in `run_callbacks' from activesupport-3.0.9/lib/active_support/callbacks.rb:414:in

    `_run_create_callbacks' from activesupport-3.0.9/lib/active_support/callbacks.rb:94:in `send' from activesupport-3.0.9/lib/active_support/callbacks.rb:94:in `run_callbacks' from mongo_mapper/plugins/embedded_callbacks.rb:28:in `run_callbacks' from mongo_mapper/plugins/embedded_callbacks.rb:23:in `run_callbacks'
  88. now what?

  89. pragmatic

  90. software is design

  91. embrace constraints

  92. engineering is design

  93. craftsmanship is design

  94. “ Glen Vanderburg Sometimes you have to move ahead with

    weak evidence and weak conclusions because you don't have time to prove them.
  95. opportunity costs

  96. be pragmatic

  97. None
  98. “ Ed Yourdon You can discipline yourself to write software

    that's good enough—good enough for your users, for future maintainers, for your own peace of mind. You'll find that you are more productive and your users are happier.
  99. Ordered List Thank you! brandon@orderedlist.com Brandon Keepers Lone Star Ruby

    Conference V August 12, 2011 @bkeepers http://spkr8.com/t/7829
  100. Credits Power lines - http://www.flickr.com/photos/viamoi/3339707547/ House of cards - http://www.flickr.com/photos/gibbons/2294374741/

    Dentists office - http://www.flickr.com/photos/cmdrcord/4996672560/ Broken chair - http://www.flickr.com/photos/gorbould/3004789912/ Schematics - http://www.flickr.com/photos/nicklockey/4547935355/ Engineers - http://www.flickr.com/photos/seattlemunicipalarchives/4818952324/ Black box - http://goldberg.berkeley.edu/art/big-images/