+ 2

What is the use of comments anyhow it doesn't have any effect on output

27th Jul 2019, 3:17 AM
Monish S
Monish S - avatar
8 Respostas
+ 5
Comments make it much easier when you have to take over someone else’s code (or they yours) so you know why it was written in such a way or any dependancies that need to be taken into consideration. I also use comments as notes-to-self for future reference in case I want to grab a chunk of code for another project. I also use comments as citations/shout-outs (like if I had help with a section of code from someone).
27th Jul 2019, 5:15 PM
Lisa
+ 3
Comments will make you remember what you did last summer.
27th Jul 2019, 5:12 AM
Tibor Santa
Tibor Santa - avatar
+ 3
No..comments doesn't create any effect on output Comments make it much easier when you have to take over someone else’s code (or they yours)
28th Jul 2019, 7:08 AM
Taniya Verma
Taniya Verma - avatar
+ 1
comments just describe and explain the code so that everyone can understand your program
28th Jul 2019, 10:06 PM
Sai Ram
0
It is made for readability reasons. Compare and contrast : #first we have a number a=1 #then we multiply by 2 a*=2 #now print the result print(a) Against: a=1 a*=2 print(a) This is a small but easy to understand program but think when you go large.
27th Jul 2019, 3:22 AM
👑 Prometheus 🇾🇬
👑 Prometheus 🇾🇬 - avatar
0
Sorry but I did not understand bcz I am new to programming languages I just started two days before
27th Jul 2019, 3:24 AM
Monish S
Monish S - avatar
0
Tibor Santa what do u mean by last summer
27th Jul 2019, 5:29 AM
Monish S
Monish S - avatar
0
Sorry, it was a reference to an old-time horror movie :p https://m.imdb.com/title/tt0119345/
27th Jul 2019, 6:44 AM
Tibor Santa
Tibor Santa - avatar