A syntax element that allows multiple lines of text to be used as comments, (that is, ignored by the compiler), without having to mark each and every line separately as a comment.
Questions tagged [block-comments]
35 questions
850
votes
10 answers
281
votes
8 answers
Best way to add comments in erb
How do we add comments in erb files, if we do not want them to be generated into the html content?

Kalyan Maddu
- 4,123
- 2
- 21
- 26
150
votes
5 answers
How do I comment in CoffeeScript? "/* this */" doesn't work
In what ways can you comment in CoffeeScript?
The documentation say you can use three hash symbols to start and close a comment block:
###
Comments
go
here
###
I've found that I can sometimes use the following two formats
`// backticks allow…

Eric Hu
- 18,048
- 9
- 51
- 67
132
votes
17 answers
Block comments in html.erb templates in rails
How do you comment out html mixed with ruby code?
some text <% ... %> more text <%= ... %>
something else
<% ... %>
In jsp it's real simple: <%-- ... --%>, but I'm unable to find any concise option in rails.
Simple html comments do…

Nikita Rybak
- 67,365
- 22
- 157
- 181
99
votes
4 answers
Block commenting in Ruby
Does Ruby have block comments?
If not, is there an efficient way of inserting # in front of a block of highlighted code in TextMate?

alamodey
- 14,320
- 24
- 86
- 112
52
votes
2 answers
How do you make a block comment in SVG
I'm trying to learn SVG for the first time but the code seems to have an issue with my block comments. I'm using:
/* This is my
* block comment
*/
And when I run my code, I get the following error:
'return' statement outside of function
line:…

ardavis
- 9,842
- 12
- 58
- 112
13
votes
6 answers
Keyboard shortcut for Visual c# block comment in Visual Studio 2015?
I know there is keyboard shortcut for single line(//....)
commenting Ctrl + K + C and uncommenting Ctrl + K + U .
My question is that, is there any default keyboard shortcut for block (/* ...... */) commenting and uncommenting? If yes how?
And If…

aimme
- 6,385
- 7
- 48
- 65
13
votes
4 answers
Lack of block comments in VB .NET?
Just a question of interest: Does anyone know why there's no block comment capability in VB .NET? (Unless there really is - but I've never yet come across it.)

froadie
- 79,995
- 75
- 166
- 235
12
votes
4 answers
How does one comment in an erb template?
I have some trivial markup that looks like the following:
<=% t'model.attr' %>
Is there a trivial way to comment that out? Just wrapping around the block will still leave the ruby code available to the…

randombits
- 47,058
- 76
- 251
- 433
12
votes
1 answer
Block Comments in Logstash Config file
I am just getting started with Logstash and wondering whether there is a way to specify block comments in logstash config file?
It will be very useful as I am testing with long grok patterns which span multiple lines.

Yellowjacket
- 548
- 2
- 7
- 19
6
votes
3 answers
Android Studio: Block comment style
Block comment style in Eclipse (write /* and press Enter)
/*
* Hello World
*/
Block comment style in Android Studio
/*
Hello World
*/
How can I make my Android Studio block comments look like the one in Eclipse? Couldn't find anything in…

Jonas Borggren
- 2,591
- 1
- 22
- 40
5
votes
5 answers
Including */ in a C-style block comment
Is there any way to include */ in a C-style block comment? Changing the block comment to a series of line comments (//) is not an option in this case.
Here's an example of the sort of comment causing a problem:
/**
* perl -pe 's/(?<=.{6}).*//g' :…

Whatsit
- 10,227
- 11
- 42
- 41
4
votes
2 answers
How do I stop Visual Studio 2019 from automatically inserting asterisk during a block comment in C++?
When using Visual Studio 2019, when I hit enter within a block comment in a C++ file it adds a leading * . I've found a solution to this problem for C# at How do I stop Visual Studio from automatically inserting asterisk during a block comment? but…

Dodge
- 43
- 3
4
votes
1 answer
Eclipse: comment entire code without it getting cut short by another comment
Say I have the following code (in C++, but that's probably not important to the question):
int main() {
....random code....
/*This is a comment*/
....random code....
return 0;
}
In eclipse, when I want to comment out the entire code…

Svavinsky
- 69
- 3
4
votes
1 answer
JavaDoc: Reduce redundancy for Repeated Method Descriptions within the Same Class
For example, i have two methods, public Tree addChild(final T data) {} and public Tree addChild(final T... data) {}, their JavaDocs are identical. How to put the /** method description */ in one of them, and use a tag to refer another JavaDoc…

midnite
- 5,157
- 7
- 38
- 52