I've been specifically learning Python 3.x and C++14 but anything would be useful.
I'm looking for some literature or guidance on how to format comments, i.e. do you need to leave a specific number of spaces / tabs between code and comment, between comment symbol(s) and comment text, how do you align comments, is it best that they are horizontally aligned if multiple following lines have comments, or is it better to have them all the same distance from the text that they follow?
I.e. which of these would be "correct":
int main() { // <comment>
code // <comment>
much longer piece of code // <comment>
these comments are all over the place // <comment>
code // <comment>
much longer piece of code // <comment>
these comments are aligned // <comment>
but it's unclear which line the comment refers when one line is much longer // <comment>>
Or something else entirely? Or is there no agreed upon best way and it's just about being clear to the reader in which case something like this might be better?
int main() { // <comment>
code // <comment>
much longer piece of code // <comment>
these comments are all over the place still // <comment>
code // <comment>
much longer piece of code // <comment>
these comments are now aligned // <comment>
and so is this one here // <comment>
but it would be too much to align to this one as the line is so much longer // <comment>>