Thoughts of a programmer

How long is long?

Keywords

How long should a method be, for us to consider it to be too long?

20 lines?

10 lines?

Fit into a window without having to scroll?

It's not as much about the number of lines of code as it is about levels of abstraction. A method is too long if it deals with more than one level of abstraction.

Comments

John Doe

http://www.example.com

How to break the bad practice?

We all know that writing long method is evil. Yet, there is so much of that in real-world applications. Do you have suggestion on how to break that bad practice?


Available for free use under creative commons.