back

by layer8·5y ago·view on hn ↗
> how do you comment out a region with comments inside?

s/^/\/\//

Or just Ctrl+/ in some IDEs.

That’s also better than multiline comments because it provides indentation levels, and because it’s visible on every line that you’re inside a comment (and no need to place artificial “*”s at the start of in-comment lines). If I were to design a new programming language, I would only provide single-line comment syntax and relegate the multiline use case to editor support (i.e. for marking a line range and commenting it out/in).

1 comments
I agree that // is the way to go but this only landed in C99, so almost 3 decades after the fact (~5 if you care about msvc support).
Good point. Even before C99, I would be using C++ as a “better C” for reasons like that.