Best way to comment large code may seem like a stupid question, because you can say "just do it, write what it does next to the class/function/variable".
But I've always found too much comments being counter productive in that the code gets cluttered and becomes less readable. So I tend minimise comments, believing that good descriptive class/method/variable names and good code structuring would do most of the self commenting. So I only add one or two comments. Other times i think- this so simple I don't really have to comment and many times this is correct. And other times i add comments when only when i'm going over a part of the code I haven't seen for a while and it starts to confuse me. At the time of coding it, it mostly never seems i could get lost on the current algorithms, but as the code keeps getting larger by the weeks/months/ (and now a couple of years), getting lost on my past code is happening more and more. ... made much worse because I tend to write really compact algorithms/code and commenting compact algorithms to the line is really impractical as it breaks the flow and gets very difficult to read.
Linking different parts has not been trivial and is even more difficult to comment without cluttering the code. But continuation helps me a lot, I try to hold all the strands and code mechanics well in my head and get fully immersed as long as I don't long breaks lasting weeks.
I'm still fine with most of my code and the overview is still clear to me, but some fine detailed stuff are really getting on my nerves and I really wished I had commented these parts better. I need to re-work this parts of the code so I can do some debug analysis without breaking anything. I need to get fully immersed , .. but tracking some of the really fine details of these algorithms remains the problem,
"Old habits die hard", I probably would only add just a brief comment in addition... just enough to satisfy the actual issue that got me lost in the first place
So I would like to know how people here find the right balance. Do you just automatically write a whole lot of stuff after every thing you declare without bothering about cluttering? Is there a standard way? Or do you do minimal commenting but good code structure ensures you never get lost?