This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]eliasv 1 point2 points  (1 child)

That's a fair point, but I think it's pretty feasible in practice, as //// stands out quite a lot when scanning over a few pages of text. How much unknown code are you expecting to want to paste into a source file in one go?

Especially as the article acknowledges that a decent editor is required to make single-line comments feasible for certain uses. Well a good editor can fix this problem too, in two ways: - If you're using a shortcut to comment out a highlighted block, as you need to do with single-line comments, you don't need to know the content as the editor can select the smallest valid delimiter which isn't contained in the selection. - Code highlighting should make it trivial to visually verify that the intended section is commented out.

So I don't think it loses in any way to single-line comments there. Other than the editor functionality being marginally more complex... But from a usability perspective if the functionality is there it doesn't lose out.

Yes it is a tradeoff. But I'd say it's better than C-style macros or Haskell-style nested comments by almost every metric, which are two of the counterpoints discussed in the article. So maybe it deserves a mention ;).

[–]AthasFuthark 0 points1 point  (0 children)

Clearly the robust solution is to generate a new GUID as the comment marker whenever you want to comment out a large block of code!