Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 23
    "I leave it until everything is done" is usually synonymous with "It will never be done". Commented Oct 1, 2012 at 8:15
  • 2
    That is generally true, but also remember the opposite principle of YAGNI (which doesn't apply in this case, since you already need it). Commented Oct 1, 2012 at 11:46
  • see also: One-line functions that are called only once Commented Nov 29, 2016 at 15:03
  • Just wanted to emphasize don't focus so much on reducing lines of code. Instead try to think in terms of abstractions. Each function should have only one job. If you find that your functions are doing more than one job then generally you should refactor the method. If you follow these guidelines it should be nearly impossible to have overly long functions. Commented Dec 16, 2016 at 5:03