+ 2

Documentation comments

Why do we need documentation comments. I mean we can use multi line comments if we only want the comments to be read on the source code

2nd Jun 2017, 2:49 AM
Uday Narayan Mukherjee
Uday Narayan Mukherjee - avatar
4 Answers
+ 14
The IDEs show the documentation comments, when you hover over a term. So they're quite helpful.
2nd Jun 2017, 5:32 AM
Tashi N
Tashi N - avatar
+ 4
You could stick to /* multiline comments */ if you want, but it's a good practice to get your code ready for a /** documentation */ to be generated... imagine you're successful with your code and you sell it to a company... They'll need to know how your code works without having to look at the source.
2nd Jun 2017, 5:36 AM
+ 1
if I want my comments to be visible to the user, only then we use documentation comment.....u can see the comment yourself when u use multiple line comment...but user is unable to because he is not having the source code ..... user just see the out of the code
2nd Jun 2017, 6:53 AM
Sunita Sharma
Sunita Sharma - avatar
2nd Jun 2017, 6:54 AM
Sunita Sharma
Sunita Sharma - avatar