dideler
8/1/2013 - 11:47 PM

How big should a function be?

How big should a function be?

  • First rule of functions is that they are small.
  • They are smaller than that.
  • Lots of little well-named functions because they will save you and everyone time.
  • Most of us don’t have to worry about efficiency of function calls.
  • Making functions small save time.
  • Classes hide in long functions.
  • Functions do One Thing.
  • They do it well, and do it only.
  • If you can extract one function from another, you should.

Uncle Bob, Clean Code, Episode 3 – Functions