Saturday, March 31, 2012

The post-PC era

The term post-PC era seems to crop up everywhere. I first came across the term in an interview of Steve Jobs and Bill Gates back in 2007 at the AllThingsD conference. Since then the term has been in vogue and everybody has an opinion as what it means. Ray Ozzie tried to describe it in a memo back in 2010. The marketing machines at both Microsoft (link) and Apple (link) have tried to describe it to their own advantage.

To better understand what it means I went researching the term Personal Computer and found a statement on Wikipedia -

In July and August 2011, marketing businesses and journalists began to talk about the 'Post-PC Era', in which the desktop form factor was being replaced with more portable computing such as netbooks, notebooks, tablets, and smartphones.

This helped clarify matters. I believe some of the blame for the above interpretation can be attributed to Apple and Microsoft. Steve Jobs with his reality distortion field helped popularize the term post-PC and Microsoft reinforced it with the I’m a PC advertising campaign. Because if we go by Microsoft’s logic, that a device running on the Wintel platform is a PC then this is definitely the post-PC era. Jeff Attwood in his blog post “Welcome to the Post PC Era” provides a compelling argument in support of my statement. But the best supporting argument is Windows 8 itself, though it is called windows the metro interface has no windows and it runs on ARM processors (but I digress here, Windows 8 is a topic for a different blog post).

So what does the term post-PC era? We seem to be equating the term PC with the form factor of the PC like desktop, laptop etc. A PC is more than it’s from factor the simple definition of the term PC is a general purpose computing device for the masses.  And by that definition this is not the post-PC era. The author of the post The Dawn of the Post-PC Era. Not is correct in saying

“So, in this non-Post-PC Era, enjoy your PC–irrespective of its diminutive form factor, flatness or lack of keyboard. It’s a PC”

But all this is geek talk. I am talking like an engineer just taking things literally and getting caught in semantics while missing the whole point all together. The term post-PC is used here to describe a fundamental change in the computing landscape - the ability to use our PC without sitting down or getting tied to a desk. It describes the advent of the era of on-the-go PCs. It also describe an era where keyboard and mouse are not the only mainstream ways of interacting with a PC but things like touch, voice, pictures (camera), motion (accelerometer), location (GPS) and many more options became mainstream. The editorial Understanding “Post-PC” describes this as

“In simplest terms, a post-PC device is a PC without the baggage. No need to support decades of legacy apps and outdated programming practices. No need to adhere to the WIMP interface. No need to be able to do everything at the expense of being great at some things. Specs are not irrelevant, but they aren’t the key metric in determining what a post-PC device can do. Most importantly, the post-PC era does not signal an end to the PC.”

And I agree. So for now I will keep semantics aside for I believe these are very exciting times to be part of the computing world and if the current time is referred to as the post-PC era, then so be it.

Sunday, March 18, 2012


I have decide to do reboot my blog and start blogging again. First came the facelift I have chose a new template and did some house cleaning. Next came the tools which will help me create the blog posts for now I have settled on the Live Writer. Hopefully it will simplify some of the tasks that frustrated me last time around when I tried to blog.

It has been 4+ years since I last blogged. So why now?

It is a milestone year for me. It was quarter a century ago I saw my first computer which started my love affair with computers.  And it was a decade ago I  started getting paid to do what I love to do the most - work with computers.

The last 25 years were very exciting years for anybody who had a passion for computers and the next 25 years will be even more exciting. Look around what has already been announced  Windows 8 Consumer Preview, SQL Server 2012 , Visual Studio 11 Beta and this is just the first quarter and just from one company Microsoft. We are not even talking about Apple here that’s a whole different story.

These are times when I miss school where I could find friends who shared my passion to play around with a new product or update. I miss the discussions and  the arguments around what was great or disappointing about a piece of software. 

So I have decided it was time to start the discussion or I should say join the discussion on the internet. My blog will be the place where I can argue or discuss my opinions regarding what is good or bad about the various computing products and hope to find not just readers who share my opinion but counter arguments.

Tuesday, November 20, 2007

Visual Studio 2008 First Impressions

Yesterday 2008 shipped and is made available for download to MSDN subscribers. For the general public a trial edition is available for download.
For Vista users my suggestion do not use the link above and go to you subscription download page. The akamai download manager on the Top Downloads page causes all kinds of problems in Vista. The security restrictions in Vista does not allow the download manager to write to any folders even the %USERPROFILE%\Downloads folder. It virtualizes all folders to the Temporary Internet Folders. Actually I had to download twice the first time I left it download overnight it download in the virtualized folder and my nightly clean up job cleaned up the temporary folders. It took me a while to figure out why I could not find my files.
On XP actually the download is faster from the Top Downloads page then the MSDN Subscription Download Page.

Warning do not be fooled by the Team Foundation Server Trial Link(Visual Studio Team System 2008 Team Foundation Server Trial (x86 and x64 WoW) - DVD (English)). Team foundation server is not supported on a 64-bit OS. My hopes were raised looking at the name but it turned that the installer won't install on a 64 bit OS.
On my first attempt to install the Installer got stuck at last step the the SmartPhone SDK. I was not even able to cancel it just go hung. I had to kill the installer. Restart the machine and do a repair then everything installed fine.
I found a few warnings and errors in the event log which did not make much sense to me. Hopefully my install is not corrupt. I was able to upgrade an existing VS.NET 2005 project and run it.
One more weird thing that happened on my machine was the suddenly I lost 8 GB space on my hard drive and had to run the disk clean up utility which was able to recover all the 8 GB space that was filled. I am hoping that had nothing to do with the install.
I hope me bad experience with the installer is just a one of case as one my colleagues reported that he was able to install the IDE without any issues.
I am currently having second thoughts whether to install VS.NET 2008 on my Vista 64bit machine. Hopefully I will install it over the long weekend.

Wednesday, August 15, 2007

Team System 2008

Brian (VSTS Product Group Manager) in his recent post published the TFS 2008 feature list. I am very happy to see some of the features specially support for SPS 2007 and SQL reporting on any server.
My organization already deployed a SPS 2007 and SQL Reporting 2005 server farms in addition to the SQL Server 2005 farm hosting our data marts and RDBMS databases. TFS 2008 will enable us to leverage the existing infrastructure rather than build all the infrastructure from scratch. The cost of deploying/maintaining TFS 2008 will be much less than setting up a dedicated high availability environment.
The only thing I am still looking for answers is the support for 64 bit OS in TFS 2008. Unfortunately the TFS 2005 middle tier was not supported on 64 bit OS. I hope TFS 2008 will be supported on a 64 bit environment. I will try to install it on a virtual machine and see if that works.

Boxing/UnBoxing Continued

Since my last post I ran across some new questions.
1. Does boxing have a performance issue or UnBoxing?
2. In case when an int has to be concatenated with string is it better to use ToString() method.

After running some tests I have concluded.
Boxing is slower than UnBoxing and ToString() is slower than boxing. So if one cannot avoid boxing do not try to use ToString() methods they seem to be slower.

My current challenge is that I have a Winform screen with 15 drop downs and 6 grids. In order to bind the the controls I am converting strongly typed Business entities to DataTables. There are quite a few properties in the business entities which are int and DateTime resulting in boxing and impacting the performance of the screens.

Hopefully I will come up with a solution to this issue soon.

Wednesday, August 08, 2007


Its been nearly three years since I last blogged and what better topic to start blogging back again than boxing/unboxing.
Most of the literature that I can find online tells me what is a boxing/unboxing operation or what are its disadvantages but none could definitively answer to the question that came up during a recent code review. Whether this code causes boxing/unboxing
class Class1
int i = 10;
static void Main(string[] args)
Class1 x = new Class1();
int a = x.i; //unboxing??
x.i= 20; //boxing??
I myself when initially came across the concept of boxing/unboxing used to think that the above code will cause box and unbox operations to be called but that's not the case. The above code does not cause boxing/unboxing.
The idea of boxing unboxing is a little little difficult to grasp and I have found lots of people(including myself) struggling with it. There is an article on type fundamentals by Jeffrey Richter which may help explain things and also there is a blog post by David Cumps which gives a nice visual explanation of boxing/unboxing
To figure out in the C# code if it has any box operation look for the following
  1. An instance of a value type is assigned to a variable/field/property of the type object
  2. An instance of a value type is cast to an instance of an object type
  3. An instance of a value type is passed to a method/property indexer which has object type as a parameter.
To figure out in C# code if it has any Unbox operation check whether an instance of a type object is being cast to an instance of a value type.
Below are the few common cases of boxing and unboxing
int j;
int i = 10; // can be any value type like float, double, Point, DateTime, structures etc.
//The standard example
object o = i; //implicit boxing
o = (object)i; //explicit boxing
j = (int)o; //unboxing
//String.Format and its variations
string.Format("Boxing {0}",i); //implicit boxing
Console.WriteLine("Boxing {0}",i);
StringBuilder strBuild = new StringBuilder();
strBuild.AppendFormat("Boxing {0}",i); //implicit boxing
ArrayList list = new ArrayList();
list.Add(i); //implicit boxing
list.BinarySearch(i); //implicit boxing
list.IndexOf(i); //implicit boxing
list.Insert(2,i); //implicit boxing (only for i)
list.LastIndexOf(i); //implicit boxing
list.Remove(i); //implicit boxing
j = (int) list[0]; //unboxing
Hashtable coll = new Hashtable();
coll.Add(i,i); //implicit boxing(twice)
coll.Contains(i); //implicit boxing
coll.ContainsKey(i); //implicit boxing
coll.ContainsValue(i); //implicit boxing
coll.Remove(i); //implicit boxing
j = (int) coll[i]; //implicit boxing for indexer and unboxing for assignment
DataTable dt = new DataTable();
DataRow dr = dt.NewRow();
dr["UntypedColumn"] = i; //implicit boxing
dr["IntColumn"] = i; //implicit boxing
j = (int) dr["UntypedColumn"]; //unboxing
j = (int) dr["UntypedColumn"]; //unboxing

Friday, October 15, 2004

Pre-compilation in ASP.NET v1.1

Today I came across Jon Galloway’s blog entry on pre-compiling ASP.NET web applications in v1.1. I have been looking for this for a while now. I tried it on with the web application I am currently developing on my development machine (Win XP Professional).
And here are the observations.
1. The handler compiles all the aspx files in the folder irrespective whether the file is part of your project. This was very troublesome for me as on my development machine there existed old aspx files which were removed from source control but they existed on my disk.
2. If an error occurs during compilation of a page the compilations stops and no other pages are compiled. Aspx pages are not classes which refer each other I think if a error occurs on a page that page should be skipped and the next page should be compiled and the list of pages which caused errors should be generated. For each time an old aspx file (no longer used in the project) was found I had to go and delete it and wait for the next error page.
3. If an error occurs during compilation and is then corrected. Restarting the pre-compilation doesn’t work. One needs to re-start the ASP.NET worker process for the compilation to work. That’s a major issue. We cannot keep on restarting the worker process each time we encounter an error during pre-compilation.
4. The handler only compiles the aspx files (and all the ascx user controls refrenced in the aspx ) in the specified folder not in all aspx pages the in the web application. In case one is developing a large website and the aspx pages are grouped in different folders one has to go to each folder for the pages to compile.
5. In my case I had forms authentication enabled so the ways I could make pre-compilation work is to either disable forms authentication for the time I am pre-compiling or through web.config grant access to the handler in each folder. Neither can be used for production environments as changing the web.config after compilation will cause the aspx to be recompiled by the runtime. The other smart thing would be login the website and the call the pre-compile page. But none of these solutions are good enough. The handler should behave something like the debug works. I can configure whether debug information is available on remote machines or only on local machines. Similarly I should be able to configure that I can make a pre-compilation request from a remote location or from a local machine. And an authorization mechanism where I can grant access to pre-compilation easily rather then listing out each folders in which pre-compilation is allowed

Overall the handler has still some issues and is very primitive to be used in an actual production environment. I think that’s the reason the handler has not been advertised. I fell its better that I wait for the ASP.NET v2.0 and see if it is good enough to be used in a production environment.

Thursday, September 16, 2004

The Debate: Should we set the value of a variable to Null after we have no use for it

Its been a long standing debate. I have found many developers setting the value of the local variables to null at the end of the method. That never made sense why should one set the value of a variable to null which will anyway be out of scope in the next line of code and will be garbage collected. It never made sense and it never will.
But Rico Mariani in his post Mid life crisis has pointed out a scenario where setting the value of the variable that are no longer used to null can be useful. But as he pointed out it in the post it needs to be done before we pass the task to some other thread and we know the variable is dead and will not be used in later processing. To understand in detail one must go through the article in detail and check out how the .Net Garbage Collector(GC) works.
learned something really interesting and useful today.

MSDN 2 is here

Microsoft has released the beta-documentation for Visual Studio 2005. I came to know about this from Krik Allen Evans's post MSDN2 and .NET Namespace Support cool new features and a different look I really find the namespace URL feature interesting, it can be very useful.