How long should functions/methods should be in average? -
We've all read a lot of long methods or actions, where your eyes are bleeding when you back Return Statement We have also seen those one-liner functions which seem useless ...
I just wanted to ask: Do you think the best average length for the function / method? is? Keeping in mind that every language has its own way, you can specify what you are talking about in your answer. Thanks!
"No matter the length of the average function" You must use thumb rule, function / method should have a very accurate functionality, which should be named after its name. If you can not define "what this does" on your name, you should split it but this length may vary, because some very specific tasks require a lot of code.
And as you have said, seeing some functions, your eyes are bloody, if they come in blood, then something is wrong with the function;)
Comments
Post a Comment