DEV Community

Discussion on: Efficiently commenting code

Collapse
val09865 profile image
val09865

I don't think this is a goods advice. Most IDE have a comment toggle fracture where you juste select some lines of code then press a simple shortcut and the IDE automatically add the comment character depending on the language of the file. You don't have to think about adding or removing character.
Your advice only apply to people who use basic text editors which is almost no one.

Collapse
siddharthshyniben profile image
Siddharth Author

It depends on how you code. I prefer to never use the mouse when possible, so selecting text is a no no (of course we can select by keyboard, but that takes a while). If you are used to the mouse, go ahead and use that method.

This is the method I personally use (in Vim) since it makes it so easy to toggle between two blocks of code by deleting just one character (I usually set a mark at that character so I can jump there easily)