I have several functions using the same complex line of code that I needed to comment on.
function thisFunction() {
[Some Code..]
*complex code line*
}
function thatFunction() {
[Some Code..]
*complex code line*
}
function anotherFunction() {
[Some Code..]
*complex code line*
}
The main problem that I see was to explain different functions several times with the same complex code using exact comment .
This is contrary to the DRY principle. My question is: "What would be the best practice to solve this problem and still allow readers to understand my code?"
My general thought was to comment on the first use of this complex line. However, I don't know if it will be 100% intuitive for other people if they read.
EDIT: , . , , , , . ?