I have to say I came here looking for an answer around 2 of comments per 1 line of code. Even if this is an exaggeration it's in the right direction! Instead I see people recommending treating comments like truffles or other rare commodity. Looking from a peculiar perspective of academia, were code quality is low and use of version control is even rarer then truffles I would urge anyone to write as much comments as possible, even against your own judgement of whether the comment is 100% necessary.
Comments make your life easier because chances are you are going to be thinking, what the hell was I thinking when writing this!