Would Like to Switch to Chrome, but ...

December 26, 2008 at 12:05 PMBen

I spent a couple of days using Chrome as my primary browser.  Chrome came out of beta on December 11th, and its version number is already over 1.0.  There's a number of nice things I like about Chrome, but for now, I've switched back to Firefox.

There's two big things I like about Chrome.  I like how each tab runs as in its own isolated process within Windows.  I leave my browser open all day, usually with Gmail open in one tab at a minimum.  Not all the memory from closed tabs in Firefox seems to get reclaimed and firefox.exe usually shows up using around 150 KB of memory mid-day even if only Gmail is open at that time.  Firefox 3 is supposed to be a lot better than Firefox 2 for preventing memory leaks, and I'm sure it is.  150 KB of memory is not a big deal, either.  But the Chrome architecture of running each tab as its own process has the big advantage of basically guaranteeing all memory used for a tab will be completely reclaimed once that tab is closed.

The other big item I like about Chrome is how you can easily drag a tab out of the Chrome window into a new Chrome window.  Especially if you have multiple monitors, this is a really great feature when you want to see two or more tabs at the same time.  I was breaking the tabs out into separate windows when composing an email in a web interface or when typing messages on forums / blogs.  I could compose my messages while seeing other information I'm referencing in the other Chrome window at the same time very easily.  After I was done composing, I would drag the tab back into the main Chrome window.

I'm back to Firefox now as a primary browser because of some features not yet available in Chrome.  The big one being Firebug.  I didn't realize how often I right-click on an element to inspect it in Firebug, check the Net tab, etc.  I also like how when you change the text size in Firefox (i.e. zooming text), how Firefox remembers the size you last had when coming back to a website.  In Chrome, you have to adjust the text size again every time you go back to a website.  Also, URLs in the status bar when you hover your mouse over a link are often truncated because the space Chrome allocates to show the URL in the statusbar seems to be a fixed width.  There's actually a lot of extra room to show the entire URL, and I hope this gets resolved soon.

So for now, Chrome is not yet ready for prime time (for me).  Google is of course working on lots of improvements for Chrome.  This includes adding an extensions framework so people can start developing extensions for Chrome.  I haven't heard of any type of Firebug for Chrome initiative, but for me, something like this would add mega value to Chrome.  I plan on sticking with Firefox which has treated me well, but checking back on Chrome every once in a while.

Posted in: General

Tags: , ,

Folders vs. Tags

December 19, 2008 at 6:05 PMBen

I still see web-based and desktop-based email applications which only support folders to file email away into.  I'm a Gmail user and have the luxury of using tags to organize emails.  Tags are actually known as labels in Gmail.  But whatever the name, tags are in my mind, unquestionably superior to folders.

I don't remember talking to anyone who said they do not find the tag system better than the folder system.  And even if a person felt more comfortable associating an email with only one identifier, a single tag can be put on an email as multiple tags are of course not mandatory.  Given the benefits of tags over folders, I can't see why any company developing an email application would not want to replace the old, inflexible folder system with a tagging system.

Folders and tags are not limited to just the email world.  They exist for bookmarking urls too.  Tags were introduced in Firefox 3 which now supports both folders and tags.  I don't regularly use other browsers, but taking a glance through IE7, Safari and Chrome, it appears FF3 is the only browser among these that supports tagging bookmarks.  FF3, Safari and Chrome also have search capability to find bookmarks.  This may seem like a given, but I don't see any bookmark searching capability in IE7.  FF3 also introduced a very cool concept of saving the criteria used in a bookmark search as a "virtual bookmark folder" so you can later click on the virtual bookmark folder to see real-time bookmark matches satisfying the saved criteria.

I use multiple tags for my bookmarks too.  I've actually been using Google Bookmarks since before FF3 was released, so I've unfortunately never spent any significant time using FF3's bookmark tagging.  The big advantage of Google Bookmarks being that I can access all of my bookmarks on any computer since my bookmarks are stored on Google's servers.  I just need to log into my Google account to access these bookmarks.  Google makes it easy to bookmark a page too with a bookmarklet they provide and I keep in my Firefox bookmarks menu.  So bookmarking a site into Google Bookmarks requires just as little work as it would be to bookmark a site into Firefox.

Whether it be emails or bookmarks, tagging has proved to be really helpful when looking for stuff later.  There's probably lots of areas other than email and bookmarks where tagging would be useful as well.  If you're stuck with the restricting folder system for emails or bookmarks, I'd suggest requesting your provider to upgrade their app to a tagging system or, if possible, move to a provider that supports tagging.

TimeZoneInfo - A Small .NET 3.5 Gem

December 7, 2008 at 4:10 PMBen

One new handy class introduced in the .NET 3.5 framework is the TimeZoneInfo class.  This class allows you to get date and time information for any time zone in the world.  Prior to .NET 3.5, the framework exposed methods to get date and time information only for the time zone the server was set at.

I've used this class to find the date/time of a place other than where the server is located.  If you're lucky, the server your website is running on will be in the same timezone you want to save and display dates and times for.  Even if you're in a different timezone, let's say in New York and your server is in California, well you can just add 3 hours to the server time to get New York time.

It isn't always this easy living in Arizona where daylight saving time (DST) is not observed.  In the summer, Arizona is in the same timezone as California (PST) three hours behind the east coast and in the winter, Arizona is in MST two hours behind the east coast.  Your server may be in Arizona but you want a west coast time for your application, or your server may be in California and you want Arizona time for your application.

If the server is in Arizona, and you want to know what time it is in California, you can use the TimeZoneInfo class to find this out.

TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
DateTime PstDateTime = TimeZoneInfo.ConvertTime(DateTime.Now, tzi);

PstDateTime now contains the current date/time in California.  This code will work year round as daylight saving time and any other adjustment rules are taken into account by the ConvertTime() static function.  So, in the winter, PstDateTime will be one hour earlier than Arizona time and in the summer, PstDateTime will be the same as Arizona time.  This functionality makes life very convenient since you don't need to worry about trying to calculate when DST starts and ends each year.

You may even want to just know if daylight saving time is in effect for any given date/time value.

bool IsDaylightSavingTime = tzi.IsDaylightSavingTime(PstDateTime);

This tells you whether it is daylight saving time for PstDateTime.  Let's check the status of DST for two different dates:

// false
bool IsDaylightSavingTimeAprilFirst2000 = tzi.IsDaylightSavingTime(DateTime.Parse("4/1/2000"));
// true
bool IsDaylightSavingTimeAprilFirst2008 = tzi.IsDaylightSavingTime(DateTime.Parse("4/1/2008"));

There's actually a handful of other static and non-static members of the TimeZoneInfo class available that can come in handy depending on your needs.  Members such as GetUtcOffset(), ConvertTimeToUtc(), DisplayName, etc. provide a wide range of built-in capability.  The list of available time zones you can pass into the FindSystemTimeZoneById method can be found via the GetSystemTimeZones method.

Posted in: Development