by Tade0 · 3y ago · 0 comments
Specifically, comments every other line quickly add up and take up valuable space. Some, like the one above `sumOfSquares` are, in my opinion, unnecessary. It's obvious from the variable name and that `for` loop what's going on there.
My experience is that the best way to make equations legible is to use their matrix form - matrices are easy to explain to anyone who can add and multiply.
I'm currently in a project that's built around a few calculations and we settled on matrices because it's a language that every team member, from the project owners to developers, understands.
Comments are basically free in most languages. Use them.