Coding Pills: clipboard ring and toggle comment

Unfortunally I’ve got the flue, so I’m here at home, alone (not so alone, cats are with me), with some time to spend. Fortunally I still have a blog where to write! πŸ™‚

Sorry guys, I’ve been very busy these times and that’s the reason why I took so long to write again. But I’m here and with your big surprise (or not) I’m writing in English.

So, just to start, I wanna write a little post with two very useful tips that I’ve found many programmers doesn’t know, but I think they should.

And those tips are:

  • Clipboard ring
  • Toggle comment

Clipboard Ring

Microsoft calls it Clipboard Ring but, for example the smart guys at JetBrains call it Clipboard History.

What’s it? Actually Visual Studio and for example IntelliJ remembers all code you have copied not only the last one.

With Ctrl+V (Cmd+V) you just obtain the last copied code, but with Ctrl+Shift+V (Windows) or Cmd+Shift+V (Mac) you could cycle around all the previous copies you have done!

Toggle Comment

The toggle comment could be usefull for fast prototyping or fast debugging when you are not sure which choice to do and are evaluating between two alternatives leaving code cleaning for the future.

The block is that:

//* this is your toggle (state on)
<uncommented code>
/*/
<commented code>
//*/

-----

/* this is your toggle (state off)
<commented code>
/*/
<uncommented code>
//*/

And here a live example:

Coding Pills: clipboard ring and toggle comment