Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Time Preference, Quality, Dopamine and Marshmallows


Published on

Some thoughts on the time preference effect, and how it interacts with making code quality decisions.

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Time Preference, Quality, Dopamine and Marshmallows

  1. 1. Time preference, quality, dopamine, and marshmallows Lunch and Learn, June 2017
  2. 2. Dopamine
  3. 3. You know about dopamine already. All the fun stuff.
  4. 4. Dopamine (or the anticipation of) makes you more likely to make a snap decision. Source: Salk’s Molecular Neurobiology Laboratory, San Diego, 2017. Publisher: Neuron.
  5. 5. Time Preference
  6. 6. We value short-term reward over long-term reward. The longer the gap between rewards, the worse the effect.
  7. 7. We prioritise dopamine release above all else when we’re using our unconscious mind.
  8. 8. As time passes, we suffer less from these manipulations. (This leads to “wise elders”. Or better pattern matching. But that is another talk.)
  9. 9. The instincts still remain — but awareness is a powerful antidote.
  10. 10. How does this affect the craft of writing code?
  11. 11. Testing. Modularity and reuse. Documentation.
  12. 12. Testing
  13. 13. Tests give confidence, accomplishment, and they save time. (this is all about time preference, remember?)
  14. 14. Tests can feel like an interruption. This is a perfect example of the struggle against the time preference effect.
  15. 15. We need to reframe the situation. Where is the short term reward?
  16. 16. Tests help us decide when it’s good enough.
  17. 17. Tests let you move on to the next problem.
  18. 18. Tests let you turn the light green.
  19. 19. Tests are your way of helping the next guy.
  20. 20. Reusability
  21. 21. Reusability and modularity leads to better software, which is quicker to build. (eg. generic implementations, function extraction)
  22. 22. It requires additional effort and thinking at the point of creation to get this right. That seems like a long-term reward.
  23. 23. Build pull requests around modules. Receive feedback and social validation. You will become a better developer.
  24. 24. Open your code. $ touch $ curl -d'{ "copyright": “FARM Digital" }’ > LICENSE
  25. 25. Permanent accomplishment is actually a short term reward.
  26. 26. Documentation
  27. 27. Comments README Diagrams
  28. 28. It’s just explanation for the next person. Future us or future others aren’t always a priority. Your mental state is in the problem, not the documentation.
  29. 29. Create clear rules. This allows us to find little bursts of success… … and lowers the mental effort to get started.
  30. 30. Good documentation helps modularity. And tests are documentation.
  31. 31. Summary
  32. 32. These are only suggestions. It’s up to you to balance immediate satisfaction and long-term value.
  33. 33. “I can resist everything except temptation.” Oscar Wilde