A comment means you need to create a new function. Really!
When a function is long, it normally means it is complex, and hard to read. One would have to use an inline //
comment to tell himself what this code was written for. In fact, he would already be a damn great programmer if he mindfulness added the comment for the sake of others. But, we can do better!
You can start to help yourself and others from today. When you begin to be aware that you are using an inline comment, use the extract tool to create a new function with proper documentation. It not only helps to reduce the function complexity, but also shouts better readability, and lets you focus on testing small functions.
Comments