Coding Trick of the Day: The Comment Swapper

On many occasion when I am programming, I want to test out a piece of code, then try another one, and go back and forth between the two. Sometimes, it’s to compare performance, other times I just want to compare the behaviors (It happens very often when testing animation).

It can be tedious to constantly comment/uncomment code. But thanks to the “Comment Swapper”, I can do this in one keystroke!

1   //*******
2   object.foobar1();
3   /*/
4   object.foobar2();
5   //*/

Try it out: by deleting/adding the slash (/) character at the beginning of line 1, you can instantly swap between the two chunks of code.

 
Advertisements

About jacklehamster

Technocraft and internet developer

Posted on June 8, 2013, in coding trick of the day, Flash and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: