Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there no multiple or block comment in Ada?

Tags:

comments

ada

Why is there no multiple or block comment in Ada programming like the C/C++ /* */?

like image 758
leuage Avatar asked Nov 22 '14 16:11

leuage


1 Answers

The Ada 83 Rationale Section 2.1 says

No form of embedded comments (within a line of text) is provided, as their utility is insufficient to justify the extra complexity. Single comments that are larger than one line are not provided. Such comments would require a closing comment delimiter and this would again raise the dangers associated with the (unintentional) omission of the closing delimiter: entire sections of a program could be ignored by the compiler without the programmer realizing it, so that the program would not mean what he thinks. Long comments can be written as a succession of single line comments, thus combining elegance with safety.

Of course modern IDEs will colourise comments, but you might not notice, and the compiler certainly won’t.

like image 94
Simon Wright Avatar answered Oct 07 '22 19:10

Simon Wright