4 ms·
Please please don't do this. It hurts readability, and relies on a subtle grammar ambiguity. Without a highlighting editor (e.g. reading a diff in a code revi
by waldrews 17y ago
Please please don't do this. It hurts readability, and relies on a subtle grammar ambiguity. Without a highlighting editor (e.g. reading a diff in a code review) I'll be scratching my head trying to read this. And tools like editors that have an imperfect parser are likely to get confused.
There's a chance you'll confuse yourself (or your code reviewer or other reader) and spend an hour debugging to find what you thought was commented out wasn't. That's not worth it to save one keystroke.
- Mintz 17y agoI think the purpose the author shared this technique for is when you need to constantly comment/uncomment a block of code for testing. I agree with you, though. Once you're done with your experiment, reset the commented lines to something more conventional.
- moe 17y agoEven then, any editor worth its salt supports comment toggling with a single keystroke anyways. Good editors (vim, cough) can even toggle lines or paragraphs regardless of cursor position. So I agree, this hack is more trouble than its worth.
- pbhjpbhj 17y agothe FF webdeveloper extension is the one I find easiest for live CSS editing - though I'm using firebug more and more - it doesn't have comment toggling (it's just a text field). Such tricks are handy. Unless you're trying to work them around CSS comment hacks!
- mjgoins 17y agoOh if I could upvote this comment more times I would. The example code here made me immediately think of the lines of code that caused the Debian SSL catastrophe.