Explore BrainMass
Share

Explore BrainMass

    Comments in Programming Languages

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Many contemporary languages allow two kinds of comments, one in which delimiters are used on both ends(for multiple-line comments), and one in which delimiter marks only the beginning of the comment ( for one-line comments), Discuss the advantages and disadvantages of each.

    © BrainMass Inc. brainmass.com October 9, 2019, 8:03 pm ad1c9bdddf
    https://brainmass.com/computer-science/debugging/comments-programming-languages-137661

    Solution Preview

    Comments are intended for human readers and are ignored by the compiler. They do NOT make the executable code longer, nor do they cause the program to slow down.

    Programs typically contain a mixture of both comment forms. Comment pairs generally are used for multi-line explanations, whereas double slash comments tend to be used for half-line and single-line remarks.

    *Both-End Comment Disadvantage: Comment Pairs Do Not Nest
    A comment that begins with /* always ends ...

    Solution Summary

    There are two kinds of comments allowed in programming languages - one in which delimiters are used on both ends(for multiple-line comments), and one in which delimiter marks only the beginning of the comment ( for one-line comments). The advantages and disadvantages of each of them are discussed.

    $2.19