4 ms·
I prefer another rule for short functions. You should be able to explain what the function is doing in one sentence. If you need two sentences, you should break
by js8 7y ago
I prefer another rule for short functions. You should be able to explain what the function is doing in one sentence. If you need two sentences, you should break it into more functions.
On the other hand, if your descriptive sentence is basically just duplicating the statements in the function, then your function is most likely too small or too granular. Depending on situation, you might be able to fix it.