3 ms·
I've seen my share of code bases and many times I've seen a long function, I've made a number of other observations: The long function has a lot of comments th
by kyberias 8y ago
I've seen my share of code bases and many times I've seen a long function, I've made a number of other observations:
The long function has a lot of comments that try to describe the different steps. The comments are often confusing because whoever wrote the comments couldn't quite understand themselves what is happening.
There is a significant frequency of bugs found in the functionality implemented or coordinated by that function.
The long function has poor code coverage.
For me, a long function is usually a code smell.
- kraftman 8y agoYeah often the comments are the names of the inner functions that should be extracted out too.