One of my heroes (Linus Torvalds) published some days ago some rant about the “correct” style of comments.
Honestly, I agree 100%! And from my POV his version c is my preferred one: for single lines and blocks of comments.
(c)
// This can be a single line. Or many. Your choice.
Had some severe discussions about this topic in past dev-teams while negotiation some “best practices/style-guide”.
Reasons:
* you can quickly comment/uncomment sections of code without worrying where the “begin” and where the “end” is
* if you used /* .. */ then “uncommenting” could result in commenting something else, because of nested comment-parts
* only drawback: comments last until the end of the line
Leave a Reply
You must be logged in to post a comment.