Search code examples
language-agnosticmetrics

How to convince your fellow developer to write short methods?


Long methods are evil on several grounds:

  • They're hard to understand
  • They're hard to change
  • They're hard to reuse
  • They're hard to test
  • They have low cohesion
  • They may have high coupling
  • They tend to be overly complex

How to convince your fellow developer to write short methods? (weapons are forbidden =)

question from agiledeveloper


Solution

  • You made a list of drawbacks. Try to make a list of what you'll gain by using short methods. Concrete examples. Then try to convince him again.