Skip to content

Instantly share code, notes, and snippets.

@bstrie
Created June 29, 2012 18:37
Show Gist options
  • Save bstrie/3019889 to your computer and use it in GitHub Desktop.
Save bstrie/3019889 to your computer and use it in GitHub Desktop.
Togglable comment blocks
/*
To comment and uncomment any code in here requires one to separately
add/remove both the start and end tags for the block comment, which can be a
bit annoying if you're toggling a block frequently, or if the start and end
points are far apart (and you're using Notepad, or something).
*/
/*
This is code that is commented out. The second block-comment-start tag,
below, is ignored as part of the comment (but only if the language does *not*
support nested comments).
/**/
//*
This is the same code as above, but no longer commented out. The only
difference is the single slash before the opening tag, causing it to be
commented out and leaving the line below as a legal construction. Thus by
adding and removing that single slash, one can "toggle" a block of code in
the absence of editor support.
/**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment