blainelang
10/19/2013 - 2:36 PM

This trick below can be used to toggle between two sets of code, with one symbol in the code with no additional short-keys to learn, and no

This trick below can be used to toggle between two sets of code, with one symbol in the code with no additional short-keys to learn, and no tool dependencies!

//*
Often, in development or debugging, we need to toggle on/off a section of code or want to swap a few lines. 
We often comment out those lines but here is a neat trick where we have the comment annotation around two 
sections of code - in my case I want to test some code with a value of 100 or 200 but this could be a tw
large sections of code that I want to toggle or swap.

Add this to you editor and just delete the first / and watch as your editor disables the first assignment
and now enables the 2nd assignment. It's the little things at times that amaze you as I sit here 
toggling on/off that first / to see my editor's reaction :)

Reference: https://coderwall.com/p/zbc2zw
*/


//*
$x = 100;
/*/
$x = 200;
//*/