Whats the point of a comment while coding? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Whats the point of a comment while coding?

3rd Dec 2018, 3:31 PM
Dominic
5 Respuestas
+ 5
It helps in documenting what a particular block of code is doing. This is very useful especially if your code is read by other people who are not familiar with your code and its logic.
3rd Dec 2018, 3:54 PM
Lambda_Driver
Lambda_Driver - avatar
+ 5
One time I started going over one of my own codes after leaving it in limbo. I got confused and ended up rewriting the code from scratch! This is where comments could have saved me the pain and the suffering of rewriting the whole thing. 😂
3rd Dec 2018, 4:13 PM
Lambda_Driver
Lambda_Driver - avatar
+ 2
To understand your code even two years after writing it.
3rd Dec 2018, 3:37 PM
Bebida Roja
Bebida Roja - avatar
+ 2
Absolutely. When rewriting from scratch is quicker than improving on what's there, something must have gone wrong.
3rd Dec 2018, 4:16 PM
HonFu
HonFu - avatar
+ 1
I definitely experienced that here on Sololearn, looking at one of my own, older codes, thinking: 'What?'
3rd Dec 2018, 4:00 PM
HonFu
HonFu - avatar