Monday, September 29, 2008

Tools to boost productivity

Recently I have been stricken by productivity bug after reading "Productive Programmer" by Neal Ford. I thought of sharing few tools which I have started using and which Have improved my productivity. I will keep on adding to this list when I start using some other interesting utility. Following is the current list :

1. Command Prompt Explorer Bar - We as power users of computers, generally use Windows Command Prompt during development/testing activities. But, opening Command prompt, switching back and forth between the GUI and command prompt is really a pain. This tool comes to the rescue. Quoting from the original source "The Command Prompt Explorer Bar is a small tool that extends Windows Explorer...Next time you need to run a program without GUI, just press the 'Ctrl+M' key combination in your explorer. A command prompt will start and appear automatically. Its current directory will be exactly the same as the current path you are browsing. And better yet the console will appear inside your explorer window ... Now you can have the best of both worlds combined together - easy and fast navigation of explorer and power of batch processing of the command prompt."

This can be downloaded from : http://www.codeproject.com/KB/cs/Commandbar.aspx


2. Dexpot (Virtual Desktop Manager) - Does it ever happens to you that you have opened so many windows that you feel your desktop is in a mess and you start losing focus? If yes, you are lucky to have Dexpot, a simple and elegant solution to this problem. Dexpot allows you to manage your desktop by creating multiple virtual desktops. With Dexpot, you can open switch between different desktops, stick the open windows to a desktop. Like, on one desktop you can open windows related to Development work, on the other you can open windows connecting to server, on the third you can open Internet explorer for your web mail and searching on Google etc. It supports upto 19 extra desktops. So, next time you feel you have opened too much windows, give Dexpot a chance to manage them.
You can download Dexpot from http://dexpot.de/index.php?lang=en


3. CLCL (Clipboard caching utility) - Generally during Coding or writing some document, we copy/paste stuff a lot many times. On Windows, traditionally we copy one item, switch to destination and paste that item. Then we copy another item, switch to destination and paste that item. And so on. Using this utility we are able to reduce this context switching time. It maintains a history of what all items have been copied to clipboard. So, we can copy more than items at once, then switch to destination and paste the items.
Download location http://www.nakka.com/soft/clcl/index_eng.html

Thursday, May 15, 2008

My Software Tweaks

Here's one of my experience on Design Patterns:
Strategy Pattern - I used strategy pattern in this scenario: "In version 6.0 of product, their is a table of Characters where each entry in table is
Char1 Char2 Value eg. A B 30
Actually each entry in this table specifies amount of space to keep between a pair of characters when these characters are rendered on the screen. Now, this was in our legacy system. In the next version 6.5 of product, the format changed to
Wide_Char1 Wide_Char2 Value1 Value2 eg. A B 30 40
Here each entry specifies amount of spacing in Horizontal writing mode and Vertical writing mode and the format of characters changed to 2- byte instead of earlier 1-byte.
Now, in yet next version 7.0 of product, the format changed. And so, was done in latest version 8.0.
So, I had 3 legacy formats of tables which were stored in the document. And, when they were read in latest version, I had to convert them to latest format.
I encapsulated the conversion code into different strategy objects - Convert6_0To8_0Strategy, Convert6_5To8_0Strategy, Convert7_0To8_0Strategy each inheriting from base class IBaseConvertStrategy
Also, I created a factory method that would encapsulate the creation of strategy object based on document version being opened.
The client code which looked like this before I refactored the code:
if (docVer == 6_0) { Conversion code for 6_0 to 8_0
} else if (docVer == 6_5) { Conversion code for 6_5 to 8_0
} else if ... ...
Also, their was a case of downsaving the current doc to legacy doc. So, this involved conversion from 8.0 to 7.0, 8.0 to 6.5 etc. So, the code was much more complicated and involved lot more details than this.
I refactored the code to put it into the above mentioned structure. After this the client code looked like this:
.... IBaseStrategy baseStrategy = CreateConvertStrategy(docVer); baseStrategy.Convert(); ....
As you can see the conversion logic is encapsulated in the Strategy objects. The client code is insulated from that.Now, suppose that the format again changes from 8.0 to 9.0. The client code won't change in this case. Only new strategy objects would be created. And this is a very big possibility that this would change again. :):):)

Any feedback on this ??????