comments specific - best commenting techniques | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

comments specific - best commenting techniques

i found a = 3 //tells what a is b = 5 // tells what b is to be conducive to good understanding as opposed to the popular style of //comment a = 3 //comment b = 5 feel free to post commenting tips

7th Sep 2017, 6:44 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
6 Answers
+ 8
Use comments to insert ASCII art into your source file. :D
7th Sep 2017, 8:05 AM
Hatsy Rei
Hatsy Rei - avatar
+ 8
lol @hatsy another great idea !
7th Sep 2017, 8:38 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 5
for short statements, variables it's good to use 1st method but when using long comments i believe the 2nd style is better. https://code.sololearn.com/cmgxEW2VFEK8/?ref=app
7th Sep 2017, 7:06 AM
Lord Krishna
Lord Krishna - avatar
+ 5
oh long comments yes but long comments use /**/
7th Sep 2017, 7:07 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 5
ah @james tedious but what a nice idea !
7th Sep 2017, 7:09 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 5
//for long comments two lines or less. I use a single line comment this way. /* for bigger comments which span more than 3 lines its better to use multi line comments but does not matter much both work just fine and have not much issues PS: I hardly write comments bigger than 2 lines . I use this only for commenting big functions, code snippets a little blurb that's all. i have a preference for using single line comments for convenience sake"// # */
7th Sep 2017, 7:23 AM
Lord Krishna
Lord Krishna - avatar