4 ms·
Agreed, use pre-compiler commands like this. Alternatively if you don't need to check in your comments then your IDE should have a "comment selection" option (
by redact207 13y ago
Agreed, use pre-compiler commands like this.
Alternatively if you don't need to check in your comments then your IDE should have a "comment selection" option (CTRL K, C chord in VS)
- Arzh 13y agoI like remapping 'comment' to ctrl-Q and 'uncomment' to shift-ctrl-Q. Makes for really quick editing of code while using the mouse.
- kragen 13y agoEmacs's is M-;.
- __david__ 13y agoOh, nice! I've been using C-c C-c but it doesn't work in every programming mode.
- jkubicek 13y agoThe disadvantage of using pre-compiler commands is that some IDEs (Xcode specifically, perhaps they all do this) don't color disabled code any differently, so at a glance you can't tell that the code block won't run. Before a commit I'll sweep through and delete the intermediate code blocks that I've commented out. If I use pre-compiler flags to comment out the code, it's easy to miss it in the sweep. Because of this I never use the pre-compiler flags for something I don't want to get committed.