Wednesday, January 14, 2009

Review : Windows Live Writer

Microsoft recently announced the final release of Windows Live Wave 3 at CES 2009. The Windows Live Wave contains a suite of applications like Windows Live Messenger, Windows Live Mail, Silverlight etc. It also contains a slightly lesser known application called “Windows Live Writer” which allows you to post articles to your blogs which may be hosted on any of the popular hosting platforms such as Blogger, Wordpress or Windows Live Spaces

I recently downloaded the Beta version of Windows Live Writer after reading some good things being written about it. I am really glad I installed this application because it is a much more efficient and user friendly way of writing, publishing and managing your posts as compared to doing it from Blogger. Setting up Live Writer is pretty straightforward. You just need to select the blogging platform and give the url of your blog along with the credentials which will be used to connect to the blog. Once that is done, Live Writer connects to the blog and downloads all sorts of information such as your blog template, list of tags defined by you etc.As a last (optional) step, it will also publish a dummy post so that you can verify that the posts appear as expected. Once this is done, you can start writing posts in Live Writer and publishing them.

Here are some of the features of Live Writer that I really like :

  1. It works OFFLINE!!!!!!!!!!! Since it is a Windows application, you can run it without Internet connectivity and write all your posts, saving them as drafts. Once you get the connectivity, you can just publish them.
  2. There are a number of options to insert items in your post including Images, Video, Map, Tables etc.


  3. There is an “Add a plug in” option which takes you to a website from where you can install plug ins for added functionality. One of the first plug ins I installed was one to format code snippets that you would like to put into your posts.
  4. Another useful option is one which lets you control what happen when a user selects the “Blog This” option from the browser. This setting can be accessed from Tools > Options > Blog This

  5. You can also see a list of the “Drafts” and “Recently posted articles” on the right hand sidebar and work with them by simply clicking the relevant article once.

  6. In addition, it has all the normal features you would expect such as Spell check, ability to publish posts in the future, updating previously published posts etc.

There is 1 feature though that is still missing and I am hoping the Live Writer team incorporates this soon. I am talking about the AutoCorrect feature which comes handy ever so often in editing software like MS Word. It is really tedious to capitalize the words yourself and to insert appropriate apostrophes instead of the software taking care of it.

All in all, it is a very good blog writing software and I am loving it. I will definitely be using it from now onwards, Good bye Blogger editor. Given the overwhelming good things to rave about, I would like to give kudos to the Windows Live Writer team for creating a great app.

Sunday, January 11, 2009

Beware when Copy Pasting

Often times, a developer needs to copy code from one place and paste it at another place, followed by some minor modifications at the destination. Of course, copy pasting the same code at multiple places such that no modification would be needed isn’t a good practice and essentially, the developer must refactor and move the common code into a function and insert function calls at the appropriate places.

There are many scenarios where the former operation is required. Even though it is at times possible to move slightly variant code into a separate function and use parameters for the differing functionality, this might not always suffice for a multitude of reasons. The code might be getting used only in a couple of places for example. In such cases, the best way to reuse code is to copy paste. However, from my experience, most errors (often times so stupid that you won’t suspect them to be the cause of problems) occur when one forgets to make a particular change after pasting the code.

One major reason why one tends to miss one or two modifications is that a very minor/no change is needed when doing such reuse (of course, if major changes were needed then one should prefer rewriting code instead of reusing). So people just assume that no change is needed and leave the code as is. Some of the changes that are needed frequently include,

  1. Change of the value of a enum
  2. Change of index variable
  3. Changing the index value.
  4. Needing to declare a variable which was available for use in the copied code but not present at the place the code has been pasted.

Forget these kind of changes and you would spend another hour trying to find the issue and fixing it. Hence, be extra careful whenever copy-pasting code to be able to make the most of the time saving gained from not having to write the code again and in case some error crops up after you pasted code from somewhere, the first check you should make is whether the minor changes like the ones for variable names etc have been taken care of.

UPDATE : After discussions with Dinkar, one important point came up which was that such errors are more likely in Weakly typed languages for obvious reasons.