Essentially, if your function is larger than what fits on your screen at one time then your function is too long. There should be no scrolling required. There are some benefits to keeping your functions at this length: It is easier to see the algorithm as a whole when you can see it all together.
It is 65535 characters to be exact. The same rule applies to the length of the class level variables as well (but not to the local variables - the one which is defined inside a method).
Most functions only contain two or three variables, so a long name is unnecessary.
Function names should be as short as possible. Calling a function and defining a function mean the same thing. A flowchart shows the hierarchical relationships between functions in a program. A hierarchy chart does not show the steps that are taken inside a function.
If there's a shorter, but yet descriptive way to name the function, then the function name is too long.
When you can't read them aloud anymore without taking a breath in the middle =D
A function name is too long when it starts to either over-describe what it does, or when it hinders readability of the code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With