Eating Exceptions… eeehhhh!

Following are few points you need to take care when you decide to eat an exception. These are very much specific to C# language.

a. Limit the code block. Attempt to wrap one or two statements within try.

b. If an exception is eaten, log details to some logging mechanism. In short never write empty catch catch(Exception) {}.

c. Never eat exception that indicates some bad behavior of code execution like - ArgumentNullException,

NullReferenceException,

ArgumentNullException,

InvalidCastException,

InvalidOperationException,

AccessViolationException, etc;

d. There is a big difference between throw and throw exeception statements. This is in terms of resetting stack trace which the later does. If you are writing a framework or want to hide your internal implementation use throw exception, otherwise use throw only.

- Ankit

Let’s Digg into Google Maps

The Web would not be so simpler and interactive without Ajax. This technology makes Web applications pleasant, interactive, quick responsive and light weight. Take any of the online map applications, no matter whether it is Yahoo Maps, Google Maps or Windows Live Local, and you will find awesome precession, cutting edge technology (beyond DHTML, XML and JavaScript) well managed data. Being software developer, these always attract me and I want to understand the scene behind those best software architectures/implementations. Over the last few days I was studying (hacking) Google maps and wanted to see how it works? Here are my investigations.

Tiles: The very first observation is – not whole map is fetched at once. Instead the entire map is divided into tiles and a series of Ajax requests are fired to retrieve some part of the actually map. As soon as a tile is fetched it is displayed at its position. Their position is well calculated no matter user drags the maps while requests are on the way. The benefit here is, the user interface remains responsive and it makes user eager to analyze an area of map as soon as it’s available.

Pune-Google-Map.jpg
(more…)