Home
Do you refactor your code and keep methods short?
  v2.0 Posted at 24/04/2018 7:34 AM by Tiago Araujo

Refactoring is all about making code easier to understand and cheaper to modify without changing its behavior​.

As a rule of thumb, no methods should be greater than 50 lines of code. Long-winded methods are the bane of any developer and should be avoided at all costs. Instead, a method of 50 lines or more should be broken down into smaller functions.

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments:

    Note: Social Media login for Yotpo is not working in IE or Safari, please use Chrome. We are waiting for Yotpo to fix it.