Wednesday, November 9, 2011

Silverlight is dying

Brian Minert, Steve Hanka and I were on our ritual lunch walk when Brian asked me, "How do you like programming in javascript?" 

"I like it just fine", I responded. "It's just another programming language".

"And you're a programmer" he replied.

I am a programmer I thought, and as a programmer I can pick up any programming language and begin producing quality software.  It shouldn't matter what programming language I'm using.  I can wield that language.  After all I was picking up on how to use javascript rather quickly.  In just two weeks I had researched out various programming techniques with javascript.  I knew how to create custom objects, simulate inheritance, and make asynchronous calls back to the server.  I knew how to serialize objects to JSON, and I knew how to manipulate the DOM.  Not bad for someone whose only professional software experience was with C# and C++.

I had been given the exciting task of porting our call center agent client software, written in Delphi, to a thin agent that ran in the browser.  The criteria for the thin agent was rigorous.  The thin agent needed to let the user make outbound calls, transfer calls to other agents, and create conference calls.  In addition it needed to let the user know when a call was coming inbound.  In fact it needed to let the user know right away, and a delay of a few seconds was unacceptable.  The thin agent was supposed to be the user's interface into our call center platform, and it's a big platform.

As time progressed I was able to make good progress on the thin agent.  Making outbound calls was easy.  Notifying the agent about inbound calls was substantially more difficult, but under the direction of Shane I was able to get that working.  I began the work of displaying other pieces of real time information.

Displaying real time information was painful.  We had chosen to display this real time information in a grid like fashion, and we chose to use HTML's table for the grid.  The HTML table is a poorly crafted and often abused tag in HTML to begin with, but dynamically adding rows to an HTML table multiplies the convoluted nature of this tag by ten.  No matter, I slogged through the complexity of HTML's arcane table, and I was able to display the real time information.

Then I got new requirements.  On the surface these requirements seemed simple enough.  They certainly were no more complicated than the requirements I had implemented previously.  However these new requirements were being added to a code base that was starting to grow out of control. 

Suddenly the code was becoming difficult to comprehend.  I had tried to apply object oriented principles to the thin agent by creating javascript objects, but I still found myself constantly looking through code files to remember how to make calls to the different objects I created.  I even tried to encapsulate the various portions of the UI in my own version of user controls but to no avail.  Simply put the code was in a state where I had to remember too many things to understand how to maintain it.

To make matters worse the code was degrading in quality quickly.  I would make changes to one of my objects to support a new feature, update all of the calling code, and execute the thin agent.  Everything would appear to work for a little while, and then all of a sudden the code would crash.  It turned out I had forgotten about a piece of code that made calls to my javascript object.  I would fix the piece I missed and run the code again.  Once again I would execute the thin agent.  Once again everything appeared fine until I hit another piece of code that I had forgotten about, and the thin agent would come crashing down again.  Whenever I had to make a change to one of my objects to support a feature, I found myself spending hours tracking down all of the calls that were made to the altered object.

Then I hit the classic javascript problem.  I was getting different behavior in different browsers.  To be exact I was getting a memory leak in Mozilla's Firefox browser, but I wasn't getting a memory leak in Microsoft's Internet Explorer browser.  The thin agent had gone from being an exciting project to being a complete nightmare.

Why was I having so many problems?  The thin agent may be a big program in javascript, but it's not that big.  I've written applications that were orders of magnitude larger than the thin agent before, and I've been able to incorporate changing requirements.  In fact at Erudite if your code couldn't cope with changing requirements it was destined to find itself in the bit bucket.  Yet here I was working on the most brittle code base I had ever worked on in my short career, and it was a code base written largely by me.

Was this code a mess because it was largely implemented by a javascript rookie?  To a degree there's probably a good amount of truth to that.  However my experience with writing an application in javascript is hardly the exception.  There are a lot of good software engineers that struggle against javascript's arcane programming structure.  At the end of the day I was wrong when I thought that the programming language you use doesn't matter.  It does matter.  The programming language is a software engineers primary tool in developing software, and it has a huge impact on his/her ability to produce quality software in a timely manner. 

At the end of the day javascript/HTML/CSS were not well suited for large software applications.  This is in large part because javascript/HTML/CSS were not built with application development in mind, they were built with document creation in mind.  It was becoming more and more clear to me that we were trying to use web technologies in a way that was not intended, and we were suffering the consequences of trying to force these web technologies to meet our demands.

javascript is not a language intended for writing large pieces of software.  Object Oriented languages are the favored languages for large applications, and javascript is not truly object oriented, as it does not even support encapsulation (all members of a javascript object must be public).  javascript is not expressive, you have to craft your javascript objects imperatively.  Finally javascript requires the programmer to have all of the code in his/her head at a given time; especially if the programmer needs to make changes to an existing object.

As I was struggling with the thin agent I kept thinking to myself: if I could just write this in a decent programming language, like C#, this project would be so much easier.  It was just a few short months later that Microsoft would announce Silverlight.

Unfortunately Silverlight 2's release was a ways out, and so we went with Adobe's Flex instead.  It wasn't until my next job that I got the chance to begin coding in Silverlight.

Silverlight was the answer to my prayers, pardon the cliche.  I loved everything about the platform.  Xaml was just such a simple and intuitive way to define your UI.  No more arcane programming logic to add objects to a grid, with Silverlight all I had to do was bind the DataGrid's ItemsSource property to an ObservableCollection of objects that I wanted to display.  If I needed to add a new object to display, all I had to do was add the new object to the bound collection, voila the new object would be displayed in the U.I.  If I needed to customize the look of the DataGrid, Silverlight gave me all of the tools necessary to do so through Templates. 

Xaml was just one of the reasons to use Silverlight.  The biggest reason was the programming language support.  With Silverlight I could use my favorite programming language, C#.  In fact Silverlight supported several programming languages including: VB.Net, Iron Python, Iron Ruby, and javascript, and these were just the languages supported by Microsoft.  Since Silverlight executes IL code the platform could be extended to support a new language simply by writing a compiler that targets Silverlight's IL code.  This made a lot of sense to me.  Developers want to be able to use their programming language of choice.  We certianly don't want some asshole at Netscape telling us what programming language we have to use to target a platform.

Programming the client in C# was a dream.  Now if I needed to make a change to a class I could make the change, hit the compile button, and fix up all of the code that was calling that class.  What used to take me several hours in javascript I could do in minutes with Silverlight.

Silverlight development kept getting better too.  After we hired Keith, he introduced us to the MVVM pattern.  The MVVM pattern was a major architectural change, but it also promised huge improvements to our code base, testability chiefest among them.  We decreed that we would do all new development in MVVM, and we even fixed legacy code to use MVVM.  Once again Silverlight was allowing us to make the code improvements that never would have been possible if we were using javascript.

Silverlight kept maturing.  The patterns and practices group at Microsoft ported Unity over to the Silverlight platform.  Once again we were able to incorporate Unity into our Silverlight application, and we were able to take advantage of Unity to write unit tests for our Silverlight application.

The more I used Silverlight the more I loved it.  This is in contrast to javascript, where the more I used javascript the more I loathed it.  Once again my experience with Silverlight is hardly unique.  In fact I'm yet to find an experienced Silverlight developer that hasn't fallen in love with the platform.

With Silverlight life was good.  We got the productivity benefits of leveraging the .Net framework, along with Silverlight's declarative Xaml.  We also got the ease of deployment benefits that come from the browser, as well as cross platform support.  Silverlight offered us everything we were looking for in a platform and more.

Microsoft looked incredibly committed to the Silverlight platform too.  In fact Microsoft chose Silverlight as the development platform for targeting Windows Phone 7.  At one point Steve Ballmer even declared Silverlight to be Microsoft's unified platform strategy.  You could use Silverlight as the Platform to target the Phone, the Web, and the Desktop.  There was even a promise of being able to target the T.V. with Silverlight in the future, Microsoft's famous three screens strategy.

Then Microsoft's PDC 2010 happened.  Silverlight was notably missing from PDC 2010.  When Mary Jo-Foley asked Bob Muglia about Silverlight she got this response: "our strategy has shifted" and " HTML is the only true cross platform solution for everything, including (Apple’s) iOS platform".

I was completely taken aback when I had read Bob Muglia's response.  I wasn't alone.  The outrage from the Silverlight community was palpable.  Microsoft quickly tried to contain the situation by hosting the Silverlight firestarter in December 2010.  However the firestarter only succeeded in creating a mixed message about Silverlight.

That mixed message would continue.  The excitement surrounding Silverlight at Microsoft seemed to virtually disappear.  Things only got more muddled when Microsoft announced their new Metro UI for Windows 8.

Windows 8's Metro UI was a perfect fit for Silverlight, but while demonstrating a demo app for Metro, Microsoft's Vice President Julie Larson-Green said: "our new developer platform, which is, uhh, it’s based on HTML5 and JavaScript..."

Things were looking worse than ever.  Not only did Silverlight appear to be dying, now Microsoft wanted us to develop Windows applications with HTML5.  Why would anybody want to do that?  Sure HTML5 adds some neat capabilities, but it still relies on the same lousy javascript programming language it is has always relied on.  Once again Microsoft's developers were outraged.  Microsoft's response was that we should wait for their Build conference, which was three months away.

We waited those long three months for the Build conference.  Finally at Build Microsoft unveiled their Metro UI platform, called Win RT.  Sure enough developers could target Win RT using HTML5 and javascript.  Microsoft had even extended the javascript libraries so you can make Win RT specific calls in your javascript code, albeit making these calls makes your javascript specific to the Windows platform (I wonder if that was on purpose).  Fortunately for .Net developers you could also build Metro apps using any .Net language, or even native C++, and we could use Xaml to markup the UI. Our worse fears were not realized.  Microsoft was not pushing .Net developers out of the fold, they were merely bringing web developers into the fold, and they were even re inviting C++ developers back.

The .Net solution for building Metro applications immediately looked familiar to those of us who have been developing in Silverlight.  In fact aside from some minor changes, the .Net solution for building Metro applications was Silverlight.  In some ways this was reassuring to Silverlight developers, because we now knew that our skill set would continue to be valid inside the Microsoft eco-system.

Unfortunately our skill set would only be valid inside the Microsoft eco-system.  There are two huge difference between Silverlight and Metro.  Silverlight is cross platform, as Silverlight applications can execute on both Windows PC's and Macs.  Furthermore Silverlight applications can be delivered via the browser.  Metro applications are delivered via Microsoft's app store, but there are some reports that Metro applications can be delivered over http, and they can even benefit from sandbox security.

Clearly Metro is not a complete substitute for Silverlight, and unfortunately Silverlight was hardly mentioned at all at Microsoft's Build conference.  After Microsoft's Build conference it seemed more and more evident that Microsoft had little intention of continuing Silverlight for much longer.  When pressed about the future of Silverlight Microsoft was consistently changing the subject back to Windows 8Finally on November 8, 2011 an article by the well informed Mary Jo-Foley appeared, reporting that Silverlight 5 will be Microsoft's last version of Silverlight.  While her article has not been officially confirmed by Microsoft, her narrative is consistent with what we've been seeing from Microsoft.

I'm sorry fellow Silverlight developers, but Silverlight is dying.  The past year many of us have been going through the seven phases of grief, I know I have.  I've even found myself mad at Bob Muglia and Mary Jo-Foley for reporting the bad news.  However with a heavy heart I've come to accept Silverlight's fate.

Fortunately the future probably isn't all that bad.  Make sure to check back for my second part: Where do we go from here.

Sunday, December 12, 2010

Why I want an iphone

My wife shocked our friends on Facebook when she posted that I want an iPhone. The reason being that I love to trash on Apple. There's so many things I can't stand about Apple, and as a result I will almost always back their competitors. In fact up until recently I've backed Google's Android phone, but I have to confess that the iPhone has forced me to change my mind. It is clear to me that Apple is one generation ahead of their competitors, and they will continue to be one generation ahead of their competitors.

In order to explain why I've decided that I want to abandon Android for the iPhone I'm going to compare the Android and iPhone feature for feature. There will be some areas where the Android will win out, but on the features that matter most to me the iPhone is the clear winner.

Form Factor
This comparison almost isn't even fair. The iPhone is sexy pure and simple. Instead of using cheap plastic materials the iPhone has a steel frame and a gorgeous glass face. It's as if the iPhone is trying to seduce any potential user into touching it.

Androids are made by a variety of manufacturers, and as a result there is no consistency in form factor across Android phones. Well there's a little consistency. In every case the Android phones look and feel cheaper than an iPhone. Some look better than others. The Droid X is certainly sexy in its own right; whereas the My Touch feels like it was made by Fisher Price. In all cases they are inferior to the iPhone. The iPhone looks and feels like a phone that shouldn't even be available for the next five years. Most of the Android phones look and feel like they should have been made available five years ago.

Hardware:
Once again another comparison that isn't fair. The hardware on the iPhone is one of a kind. The iPhone 4 sports a display with a resolution so sharp it would be almost impossible for the human eye to detect anything sharper. There isn't another device out there with a resolution as sharp as the iPhone 4. The iPhone 4 uses the incredibly powerful Hummingbird processor. This processor is what allows the iPhone to produce the high quality 3D graphics that we see running on the iPhone 4.

It's impossible to pin down the specs for Android, because Androids are made by different manufacturers, and each manufacturer can choose what kind of hardware they want to put in their phone. Some phones have terrific hardware. For example the Samsung Galaxy S uses a Hummingbird processor, just like the iPhone 4. The My Touch on the other hand uses an incredibly weak 256 Mhz processor, that can barely keep up with surfing the web. The real problem here is fragmentation. Just because you have an Android doesn't mean you have a good Android. Furthermore Google refuses to provide any framework to require a minimum set of hardware for applications. I can download Angry Birds on my My Touch, but it doesn't play very well at all.

Operating System:
This comparison comes in a lot closer. The iPhone runs on Apple's iOS 4. iOS Is certainly a great operating system. iOS has proven itself to be stable streamlined operating system. iOS has an incredibly intuitive and easy to use interface. In fact iOS is so simple to use that my three old son can navigate the operating system with ease.

iOS is also consistent. Apple is the only company that is allowed to make changes to the iOS operating system. The result is every iPhone looks and feels the same. Furthermore since Apple controls the hardware and the Operating System, Apple can be certain that all updates will run on every iPhone. You don't have to wait six months after a new Operating System is released before you get it on your iPhone, and you don't have to worry about the new Operating System turning your iPhone into a useless piece of junk.

Like iOS, the Android operating system is a great operating system. The user interface is clearly inspired by Apple's iOS, and as a result the user interface is very intuitive. Android has proven itself to be a very capable and stable operating system. We're even starting to see Android used on platforms it wasn't intended for; such as Netbooks.

Unlike iOS the Android operating system can be altered by the different phone manufacturers. For example: HTC extends the Android operating system with their Sense UI. The result is the user experience will vary across different Android devices. Even worse, the Android operating system has become fragmented, presenting serious challenges to application developers.

The must frustrating aspect of the Android operating system is the upgrade process. Since Android phones have different manufacturers and different sets of hardware, the phone vendor has to determine if a new operating system is ready for your phone. Users will find themselves waiting upwards to six months for an operating system upgrade. Furthermore there's no guarantee that the new operating system won't make your experience with your phone worse. I have a My Touch that I purchased just one year ago. Now that I've upgraded to the new Android operating system the phone has turned into a non responsive, worthless piece of junk.

Web Browsing
iPhone users can browse the internet using Apple's Safari web browser. Safari is one of the most well respected web browsers around. Safari is almost always the first browser to support the new standards set forth by the w3c. The current version of Safari has very strong support for HTML 5. This means that Safari can display vector graphics using the canvas tag, and it can display videos without the need for third party plugins, such as Flash or Silverlight.

It's a good thing that Safari has support for the HTML 5 video tag, because Apple refuses to allow Flash onto the iPhone. Apple has their reasons, but I think most of their reasons are terrible. True most web sites you visit will work just fine with Safari, but there are still plenty of web sites that rely heavily on Flash. Why shouldn't they? Flash is installed on over 99% of computers. Web Designers should be allowed the freedom to use a platform that's available on 99% of devices. Furthermore as great as standards are they are slow in the making. Adobe consistently makes improvements to their Flash player, but it has taken the w3c over ten years to come up with the existing HTML 5 standard, and they won't be done with the HTML 5 standard until 2022. That's a long time in technology years. Flash will continue to enhance the web experience by providing capabilities that are not provided by standard web browsers, and iPhone users will be unable to experience these enhancements.

Android users browse the internet using Google's Chrome browser. In almost every respect Chrome is Safari's equal. This makes sense, because both Safari and Chrome are built on the open source Web Kit engine. What this means is all improvement made by Google to Web Kit are available to Apple, and all improvements made by Apple are available to Google, so as far as the browsers are concerned they're essentially the same. Android has a huge edge over Apple in that Flash is available to the Android. I made the case for Flash in the previous paragraph.

Software
In my mind this is the most important category. Software is what adds the real value to any computing device. Without software all you have is a paper weight. It is also in this department that the iPhone has the clear advantage.

First there are the number of applications available in the iPhone's app store verses the apps in the Android Market place. Apple has always had a huge lead when it comes to the sheer number of apps that are available in the app store.

Of course who really cares about the sheer volume of applications? What we really care about is the quality of the applications. Apple has an approval process for apps before they can be placed on the App Store. Part of this process can be a bit draconian, but the thing I love about Apple's approval process is they require all of their apps to meet a certain level of quality. Google has no such process. I don't know how many times I've downloaded an app off of the Google Market Place only to launch the app and discover that it simply does not work.

Then there's finding an application. Google's Market place is terrible when it comes to finding quality apps. The result is even if there are quality apps on the Google Market place it doesn't really matter, because the user can't find them. Conversely Apple's app store is famous for making high quality apps easy to find.

One argument I consistently find in favor of Google's approach is that apps on the Google Market place are free, and you have to pay for apps on Apple's app store. Well most of the apps on Google's Market place should be free, because most of those apps are worthless. I'd rather pay $1.99 for a high quality app that works great than get an app that doesn't even launch. In the off chance that I do find a good app on the Google Market place it usually isn't free, and it will often times be more expensive than the iPhone version. Take Doodle Jump as an example. The iPhone version of Doodle Jump is vastly superior than the Android version, but the iPhone version only costs $.99; whereas the Android version runs for $2.99. Furthermore the notion that Android users are unwilling to pay for apps is beginning to permeate throughout the developer community and the content provider community. The result is the iPhone will continue to attract high quality apps, and the Android will get the apps that people threw together in their spare time.

Video Games
Since video games are software this is really a sub category of the previous category, but since I love video games I decided to make this its own category. When it comes to video games the iPhone doesn't have any competitors amongst the smart phone players. In fact it's true competition in this arena comes from dedicated video game devices; such as the Nintendo DS and the PSP, but this article isn't comparing the iPhone to video game devices, it's comparing the iPhone to the Android.

The Android's line up of video games is terrible. I have three video games on my Android: Age of Empires, Robo Defense, and Doodle Jump. Every time I look at these games I start to feel just a little bit sad. The iPhone line up is so strong that it gives dedicated video game devices a run for their money. Instead of playing Age Of Empires iPhone users get to play Civilization. Instead of playing the crappy version of Doodle Jump that's available on the Android, iPhone users can play the real version of Doodle Jump. The list of high quality video games for the iPhone goes on and on.

Then there's Infinity Blade, developed by Chair Entertainment and running on Epic's mobile Unreal 3 engine. Infinity Blade doesn't belong on a phone. At least you wouldn't think it did looking at it. The game is too good looking. Infinity Blade belongs on the Xbox 360 or PS3. In fact Infinity Blade looks better than most first generation Xbox 360 and PS3 games. This game is simply stunning. If I had seen a picture of Infinity Blade just one year ago, and I was asked how long it would be before we would see a game like that on a phone, I would've said at least five years, and that is why I want an iPhone, because in all honesty I don't think the iPhone 4 should even be available right now. I think we should have to wait at least five more years before a device like this is available, but it's available right now.

P.S.
Unfortunately the iPhone is still only available to AT&T subscribers. I have no plans of ever moving to AT&T. Here's hoping it comes to Verizon soon.

Wednesday, June 2, 2010

apple: Success through Simplicity

Those of you who know me know that I'm no fan of apple. There are a lot of reasons why I can't stand apple including: their closed nature, their oppressive policies regarding what applications run on their devices, and their CEO's love affair with black turtle necks, but my biggest pet peeve with apple is: their fans are just an incredibly irritating group of people. Despite all of these annoyances apple's success story is undeniable. apple has come back from the brink to become the power house it is today.

apple's success has left a lot of us scratching our heads. This was a company that just ten years ago was left for dead. Since that time apple has staged one of the largest come backs in corporate history. How did they do it? apple's comeback is a story about a company that eschewed the major trends of its day in order to create a refreshing line of products that would attract consumers the world over.

Ten years ago the major computer manufacturers were Dell, HP, Gateway, and Compaq. These four companies essentially sold the same product: PC's running Windows. In order to win over consumers all three companies decided to attract consumers to their products by offering lower prices. While this strategy may seem logical it led to disastrous results for all involved. Casualties ensued with Gateway going out of business and Compaq being acquired by HP.

Even with Compaq and Gateway out of the way HP and Dell continued to compete on price resulting in very low margins for both companies. In order to cope with these low margins Dell and HP began cutting corners by using inferior components in their products. This resulted in low quality devices.

Of course HP and Dell couldn't just compete on price, they also competed on features in the form of software. HP and Dell began offering their computers with preloaded software.

The software strategy was a complete failure. Dell and HP were more concerned about offering a large suite of software than they were about improving the user experience. Essentially they were hoping that their consumers would see that one brand offered more software than the other and mindlessly conclude that they were getting a better deal. In the end most of the software that came with these PC's was useless, and since the software would hog computer resources the computers actually began to run slower.

The result of this war between Dell and HP was HP and Dell were getting poorer and consumers were getting frustrated with the inferior offerings that were coming out of these companies.

HP and Dell were locked in a losing battle, and apple refused to play along. apple launched a new Macintosh computer running their new OS X operating system.

apple's approach towards marketing the Macintosh was different from HP and Dell in almost every way. Instead of competing on price apple competed on quality. apple's strategy was to offer a premium product at a premium price and reap premium margins. HP and Dell were charging less than $1,000 for their computers, and apple was charging closer to $2,000.

apple's dedication to quality has paid off. Today Dell and HP are famous for their poor quality products; whereas apple can boast that it has the highest consumer satisfaction rate of any technology company. apple has become synonymous with quality.

apple didn't just offer a high quality product, they also eschewed HP and Dell's tendency to favor features over the user experience. apple understands that a great user experience isn't just the result of what's available in a product, it is also the result of what isn't in a product. Instead of packaging a bunch of worthless software, apple carefully packaged in software that they knew their users would use. This minimalist approach would become a staple for apple in their future products.

apple's approach to their Macintosh helped them to carve out a healthy niche in the market, but it's their highly successful ipod that has catapulted apple to their status as a strong leader in technology. apple has cultivated their ipod product line from a simple mp3 player to their flag ship product.

The original ipod has apple's minimalist fingerprints all over it. When the ipod was released competing mp3 players were encumbered with a myriad buttons. The ipod had a wheel and one button. This simple user interface allowed users to do everything they needed to with their ipod.

Today the ipod has evolved to become the standard bearer for handheld computing devices. The most powerful devices in the ipod line are the ones that run the iphone OS. These include: the iphone, the ipod touch, and the ipad. Each of these devices is elegantly designed, simple to use, stable, and incredibly powerful.

The iphone OS devices are incredibly powerful, and it must have been tempting to cram a bunch of features into these products. apple managed to exercise the restraint it is famous for and again favored usability over feature. The ipod touch is so simple that my two year old son was able to figure out how to use it without any direction from myself or my wife. I seriously doubt I could put my two year old in front of my Windows 7 computer and expect him to figure out how to operate it. Sure the ipod touch isn't nearly as powerful as my PC, but that's part of the beauty of the ipod touch. apple deliberately left out the powerful features of the PC in order to deliver a streamlined device for its customers.

Now apple has released the ipad. If you've followed me on Facebook you know that I love to make fun of the ipad. It's poorly named, and it really is just a giant ipod touch. The fact that the ipad is just a giant ipod touch is actually a tribute to apple's genius. apple realized that the only real limitation that kept the ipod touch from being a great content consumer device was its size, so instead of cramming a bunch of unnecessary features into their product apple just made it larger. Once again apple favored the user experience over features. The results? The ipad is the first successful tablet computer, a feat that Microsoft has failed to achieve over the last ten years.

apple garnered success by eschewing the popular trends of its day. Instead of focusing on price, apple focused on quality. Instead of focusing on features, apple focused on the user experience. There's one more trend that apple had to eschew in order to make its products a reality, openness.

With the rise of the internet came the rise of openness. The internet relies heavily on open standards as provided by the w3c, and it has provided open source products with a great distribution model. The guiding wisdom today is that openness leads to better products. The guiding wisdom is wrong.

Open standards and open source rely heavily on collaborative efforts in order to succeed. Unfortunately collaboration doesn't play well with the creative process, and technology is a creative process. Somebody needs to have the creative vision for a product, without that you end up with a mess.

Witness HTML 4, JavaScript, and CSS, the results of the w3c. These technologies are a mess. JavaScript is one of the most arcane programming languages available, HTML 4 is completely insufficient for our needs, and CSS is just a kludge to make up for HTML 4's many issues. You don't believe me? Try writing a full blown highly interactive application with these technologies. Now try using a technology that came out of a closed shop, like Microsoft's Silverlight.

What's worse is these collaborative efforts takes forever to come up with new results. Silverlight has been out for 2 1/2 years and we're already on version 4. The w3c projects that they won't finalize the standard for HTML 5 until 2022.

In the opening paragraph I criticized apple for being closed. The irony is apple's success could not have happened if they were open. apple needed to create high quality products that focused on the user experience. If apple had employed the open model that could not have happened. Too many people would have thrown in too many features, and the products would have been ruined.

With apple's success we can witness apple's influence. Simple user experiences are becoming increasingly popular. Nintendo took apple's lead and created a controller that was simple and easy to use. Microsoft is taking that even further with project Natal, a user interface device that is completely void of buttons. In the 90's Software packaging typically contained a matrix that would compare their features to their leading competitor. Today we see software companies focusing on simple slimmed down software that focuses on the user experience instead of features.

apple's success story is inspiring. apple went from a dying company to a vibrant leader in technology. apple succeeded by changing the landscape of the technology industry, by focusing on quality and user experience over features and price.


Monday, February 8, 2010

Nintendo's Wii: A unique console

Wii

I originally wrote a post comparing the Nintendo Wii to the Xbox 360. I've since decided that the Xbox 360 and Nintendo Wii are so different that a comparison is silly. In this post I will attempt to describe what the Nintendo Wii is, how it is unique, and I will attempt to dispel some of the common fan boy criticism that is typically directed towards the Nintendo Wii.

The Nintendo Wii is easily the most unique video game system of this generation. Historically video game console vendors focus their next generation efforts by vastly improving the computational capabilities of their console. Sony and Microsoft continued this tradition by building veritable super computers with their High Definition offerings. On the other hand Nintendo has put almost no effort into advancing video games in terms of graphics. Nintendo set out to advance video games by fundamentally changing the way humans interact with with the machine. The results are fascinating. In three short years Nintendo's console has become the number one video game console, outselling the Xbox 360 and PS3 combined. Nintendo's console has been so successful that both Microsoft and Sony are releasing their own efforts to further advance the way humans interact with machines this year.

Video game controllers have evolved substantially since the release of the first joystick. I remember when I first played an Atari the controller had a single joystick and two buttons. The Xbox 360 controller has two analog thumb sticks, four shoulder buttons, four standard buttons, and a d-pad. For those of us that have been playing video games since we were children, the Xbox 360 controller is a great fit. It works well for just about every type of video game, and it works great for First Person Shooters. For those that have not been playing video games the Xbox 360 controller is unintuitive, cumbersome, and intimidating. With a controller like the Xbox 360's it becomes impossible to convince potential newcomers to play video games.

The Nintendo Wii's controller has two action buttons, a trigger button, and a d-pad. A player can hold the Wii controller with two hands much like the NES controller of old, or the player can hold the controller with one hand like a wand. The real innovation in the Wii controller is its support for gestures. Instead of pressing buttons to swing a bat in a video game, players swing the Wii controller like a bat, or like a tennis racket in the case of a tennis game. The genius of the Wii controller is that players interact with a video game much like they would in real life. This intuitive interaction lowers the barrier to entry, and allows people that have never played video games before to enjoy the Wii immediately.

The Wii controller has opened up some fascinating opportunities for video games. There are several video games on the Wii that just cannot be done on any other system. Try out Wario Ware on the Wii sometime. Wario Ware is a collection of mini games that takes full advantage of the Wii. The game is fun intuitive, and it cannot be done on any other console.

The Wii controller is great at opening up new opportunities. The real strengths of the Wii controller can most easily be seen with simple games like Wii Sports, or party games like Wario Ware. There have also been some attempts to utilize the Wii controller with more traditional types of video games; such as action games and first person shooters. While the Wii controller manages to function for these types of games, I wouldn't say it's been successful.

Typically more traditional games on the Wii will utilize the nunchuck setup. With the nunchuk setup the user attaches another controller that has a thumbstick and a couple of additional buttons to the Wii controller. The user holds this new module in his/her left hand, and the Wii controller with his/her right hand.

In many ways the nunchuck controller setup defeats the original intent of the Wii of providing a simple intuitive experience. The nunchuck controller is easily as complicated as the Xbox 360 and PS3 controllers. What's worse is the nunchuck controller doesn't work nearly as well for traditional games as the Xbox 360 and PS3 controllers.

If the player is playing an FPS on the Wii he/she will use the nunchuck thumbstick to move forward and backward, strafe left and right. The player will use the Wii wand to look up and down, and turn left and right. Unfortunately unlike the Xbox 360 controller there is no resting position for your aiming controls, which is unfortunate since you spend most of your time in the rest position when playing an FPS. Furthermore using the Wii wand to turn in an FPS doesn't work nearly as well as just using the right thumbstick on an Xbox 360 controller. Typically when playing an FPS on the Wii all I can think about is how cumbersome the controls feel and how I wish I had an Xbox 360 controller.

When it comes to action games the Wii controller actually works just fine. Typically in an action game the player will move his/her character with the left thumbstick on the nunchuck, attack by shaking the Wii wand, as well as aiming using the Wii wand. While this setup works just fine it really just replaces button presses with waggling the Wii controller. It's while playing these types of games that the Wii controller feels like a gimmick. Normally this would be fine, but gamers that purchased the Wii sacrificed the vastly superior graphics capabilities of the PS3 and Xbox 360 for a unique controller experience with the Wii, and in the case of action games the Wii fails to deliver a unique experience.

The Wii may not be the ideal console for the more traditional line up of games, but that doesn't mean that there aren't any traditional games in the Wii's line up. Nintendo has brought us "Zelda: Twilight Princess", "Metroid Prime 3", and "Mario Galaxy". Additionally third party publishers have produced games such as: "Conduit", "Red Steel", "Dead Space: Extraction", and "Call Of Duty: Word At War". All of these games have been well received by critics, but unfortunately only Nintendo's offerings are selling very well. For example in it's first week "Dead Space: Extraction" only sold a dismal 9,000 units. In fact third party sales have been so poor on the Wii that many third party publishers are changing their strategy for the Wii, and I suspect that many third party publishers will abandon the Wii altogether.

The issue that third party publishers are grappling with is the realization that the Wii caters to casual gamers. Casual gamers are gamers that tend to prefer the lighter more simple type of games that the Wii lends itself so well to. Casual games focus their efforts on offering the game fun short moments. These are games like the aforementioned Wario Ware, and the popular Wii fit.

Third party publishers also need to deal with the fact that the typical Wii owner gravitates to Nintendo's offerings. This environment makes it very difficult for third party publishers to succeed on the Wii. Nintendo is aware of the challenges facing their third party publishers, and they are working hard to help third party publishers find success on the Wii, but the fact remains that third party publishers have done poorly on every Nintendo console since the N64. It will be difficult for Nintendo to convince third party publishers to continue to invest their efforts in the Wii. Gamers can expect to see the presence of third party publishers continue to diminish on the Wii as third party publishers migrate their efforts away from the Wii and towards the Xbox 360 and PS3.

The Wii may lack a strong hardcore lineup, and it may be hemorrhaging third party developers, but the Wii still has the strongest lineup of casual games on the market. Chances are if you are interested in a Wii the you are interested in it because of its innovative casual games, so the lack of hard core games and third party publishers isn't an issue for you. If you're the casual gamer then Nintendo has you covered.

Nintendo's success with the casual crowd has generated a lot of controversy with the hard core gamers. A lot of hard core gamers feel threatened by the success of the Wii. They believe that Nintendo's success will convince other developers to abandon making the hard core games that they love, and instead focus their efforts on the casual games. This concern is completely unfounded, and it demonstrates a lack of understanding of basic economics. The Wii isn't converting hard core gamers into casual gamers, so the market that existed for hard core gamers previously still exists today. In fact if anything the Wii is convincing a whole new breed of gamers to give video games a chance. This can generate new sources of revenues for the video game industry, and some of these casual gamers may even take an interest in hard core games, further increasing the demand for hard core games. Furthermore its difficult to convince me that hard core gamers are suffering at the hands of the Wii with the fantastic line up of hard core games that can be found on the Xbox 360 and PS3. This generation has seen the best and biggest line up of hard core games of any gaming generation. Hard core gamers have seen all of their favorite genres make major advancements. RPG's this generation are bereft of their outdated and tedious mechanisms. First person shooters have engaging story lines and the best online game play we have ever seen. These hard core games are selling very well, and as mentioned previously most publishers are struggling to make money with casual offerings on the Wii.

Hard core gamers may not like the Wii, but they should still celebrate it. The Wii may not have the strongest hard core offering, but it has succeeded in convincing millions of people to purchase a video game system that would not have done so otherwise. Case in point: my older sister owns a Nintendo Wii at her own request. This is the same sister that used to tease me about playing video games as a kid. There is no way she would have purchased an Xbox 360 or a PS3.

The Wii is also changing the way all of us interact with our favorite video game system. This year Sony is going to introduce its own Wand controller, and Microsoft is introduce its highly ambitious project Natal. Unlike Nintendo Sony and Microsoft know how to cater to the hard core crowd. I suspect that Sony and Microsoft will find ways to make these new control devices enjoyable for hard core gamers. If Nintendo had not introduced the Wii Sony and Microsoft would never have taken this leap.

The Nintendo Wii has led the charge in changing human machine interaction. Nintendo's Wii may not be the best console for the hard core gaming crowd, but it has made huge strides in convincing a lot of people that would ordinarily not play video games to dive into the video game world. The Nintendo Wii is changing the way all consoles interact with their audience, by inspiring Sony to introduce its motion wand and Microsoft to create project Natal.



Friday, January 8, 2010

XBox 360 Vs. Wii

Xbox 360 Vs. Wii

This generation of consoles kicked off a little more than four years ago with the launch of the Xbox 360. This has easily been one of the most exciting generation of consoles. Microsoft has aggressively moved video games forward with their powerful XBox 360 console and their Xbox Live service; whereas Nintendo has pioneered video games into brand new territory with their Wii and its innovative controller.

You may be wondering which console to purchase. Should you purchase a Wii, an Xbox 360, or both? Both consoles are radically different from each other. The Xbox 360 focuses its attention on superior graphics, online multi player, and major evolutionary improvements to traditional video games. The Wii on the other hand is anything but traditional. The Wii attempts to bring new innovative experiences with its unique controller and its very non-traditional line up of games. In order to determine which console suits you, you need to be aware of each consoles' strengths and match them up with your gaming interest. Personally I have a favorite console. In fact I love one of these console, and I have a tendency to loath the other. Naturally this makes it difficult to write an unbiased review, but I also recognize that just because I like one console doesn't mean you won't love the other. Just don't be surprised if you don't like both.

The Xbox 360
The Xbox 360 is a power house of a console. The Xbox 360 sports high definition graphics up to 1080p, comes packed with 3 Power PC G5 processors, an ATI graphics card with robust shader capabilities, and 512 MB of shared memory. Simply put the XBox 360 launched as the most powerful console ever made, and four years into its life it has managed to keep pace with the supposedly more powerful PlayStation 3. This is a console that surprised gamers with its graphical prowess when it was announced and continues to impress to this day.

Unfortunately Microsoft rushed the Xbox 360 out the door in order to get a head start on their competition. The result is the first batch of Xbox 360 were defective and would eventually die. This is the infamous Red Rings Of Death, which is a play on the Blue Screen Of Death we all remember from Windows. Fortunately Microsoft has addressed the causes of the dreaded Red Ring Of Death, and every console comes with a three warranty for the Red Ring Of Death problem.

Of course all of that power housed in the XBox 360 means very little without content, and the library on Microsoft's console will make any hard core gamer envious. The XBox 360 is the only console where gamers can play the venerable Halo series. Halo is easily one the best First Person Shooters out there, but this isn't the only exclusive game that you'll find on the XBox 360. You'll also find Epic's Gears Of War (1 & 2), Fable, Blue Dragon, Lost Odyssey, Mass Effect (1 & 2), Alan Wake, Crack Down (1 & 2) Shadow Complex, Halo Wars (the only good console RTS) and the list of exclusives goes on. Those are some of the best shooters and RPG's available on any system, and you'll only find them on the XBox 360. Other notable exclusives include Rare's Viva Pinata (1 & 2), and Banjo Kazooie 3.

Exclusives are really just part of what the Xbox 360 has going for it. As a gamer you're really concerned about all of the games available on the system, and this includes multi platform games. These are games that are available on two or more consoles. Most hard core games are published for both the Xbox 360 and the Sony PlayStation 3. The lineup of multi platform games available for the Xbox 360 is very impressive. Once again almost every major RPG from Final Fantasy XIII to Fallout 3, to Dragon Age is available on the Xbox 360. The Xbox 360 sports the best shooters on any console. Infinity Ward's Call Of Duty: Modern Warfare 2 is one of the best first person shooters ever made, and its available on the Xbox 360 and PS3. In fact almost every shooter available to a console is available on the Xbox 360. When it comes to action games the Xbox 360 continues to impress. Most of the top tier action games are available on the Xbox 360; including Devil May Cry 4, Ninja Gaiden 2, Bayanetta, and the upcoming Alan Wake and Dante's Inferno. Only the PS3 has a better line up of action games, and even then that's debatable.

When it comes to online gaming the Xbox 360 is the king of the consoles. Microsoft pioneered online gaming for consoles when it first released Xbox Live for its Xbox console. Microsoft has continually updated Xbox Live, and today Xbox Live has evolved to become one of the richest online gaming and media services.

The core function of Xbox Live is to allow gamers to play games together over the internet. Gamers do this by creating an Xbox Live account with a Gamer Tag. A Gamer Tag is a friendly name that others can use to identify your account; for example my Game Tag is: Virus Hunter. You can give your gamer tag to your friends and they can add it to their friends list. Once you've added a friend to your friends list Xbox Live will notify you when they're online, what game they're playing, and it will let you know if you can join their current game or not. Furthermore you may choose to invite them into your current game. It doesn't matter if they're playing Halo and you're inviting them to play Call Of Duty: Modern Warfare 2. Your friend will see the invite and he/she can choose to accept it. Once your friend has accepted your invite he/she will join your game.

What if you just want to talk to your friend over Xbox Live? That's supported too. You can invite your friend into a private chat, and you'll be able to talk to him/her using your Xbox headset. If you want to talk to more than one friend at a time all you need to do is create a party chat and invite your friends to the party chat. It doesn't matter if all of you are playing different games you can still chat with each other.

Xbox Live isn't just for video games though. Xbox Live is also one of the best online movie services available. Using the Zune Marketplace you can rent movies from Xbox Live in standard definition or high definition. If you have a 4 Mbps internet connection you don't even have to wait for high definition movies to download; instead you can just stream them in real time, and the quality is shockingly good. If you have an Xbox Live gold account and Netflix you can also choose to stream Netflix on demand movies to your T.V.

Xbox Live is continuing to evolve. For Social Network junkies Microsoft has support for both Facebook and Twitter. The Facebook and Twitter applications are fully featured. You can update your status, follow your friends, and view your friends' pictures all from your Xbox 360. If you choose to use these services though I recommend picking up the qwerty keyboard attachment for the Xbox 360 controller.

As you can see the Xbox 360 seeks to serve up a variety of new features from video games, to movies, to social networking. In each area it performs magnificently. The Xbox 360 competes by offering a strong set of content to its consumers. This content is all AAA, and it is also very traditional content.

Wii
The Xbox 360 may offer up a strong set of traditional content, but the Wii offers value to its customers with a completely non traditional video game experience. The goal of the Wii is to bring video games to the masses. The Xbox 360 may be one of the most powerful consoles ever made, but all of that power can be intimidating. The Wii attempts to bring gamers into its fold by being more approachable.

As far as system specs go the Wii is weak. In fact it's so weak that Nintendo refuses to publish the Wii's system specs. We do know that the Wii uses a Power PC G4 processor, an ATI graphics card, and it comes with 512 MB of flash storage, not to be confused with system memory. Unlike the Xbox 360 and the PlayStation 3 the Wii doesn't support high definition video. The reason is the Wii doesn't try to impress gamers with its graphical prowess; instead it lures gamers in with its innovative controller.

Video game controllers have become fairly complicated. The Xbox 360 controller has a directional pad, two joysticks, four buttons at the top that are meant to be pressed by your index fingers, and four buttons just above the second joystick, these are supposed to be pressed by your right thumb. While the Xbox 360 controller works well, it is also very intimidating to new gamers.

The Wii controller is much simpler. The Wii controller comes with a directional pad, two main buttons, and a trigger button for your index finger. The Wii controller also supports gestures. Instead of pushing a button players are encourage to act out the actions they want their characters to do on screen. You want your character to swipe a knife then swing the Wii controller like a knife. You tell your character to swing a sword by swinging the controller like a sword, or hit a tennis ball by swinging the controller like a tennis racket, etc... The idea with this controller is to simplify games by having players act out the moves they want their characters to do; instead of memorizing potentially complex button combinations.

While the concept of the Wii controller is exciting its actual implementation has been a bit underwhelming. The real problem with the Wii controller is it lacks precision. What ends up happening in most games is button presses get replaced with waggling the Wii controller. Just try Wii tennis. You'll probably start off by swinging the Wii controller like a tennis racket, maybe you'll even attempt to put some top spin on the ball. Play the game long enough though and you'll realize that all you need to do is shake the Wii controller like you would shake a pencil and you'll get the exact same results. It's at that moment that you'll realize the Wii controller is actually little more than a gimmick.

Fortunately Nintendo is addressing the lack of precision on the Wii controller with Wii motion plus. Wii motion plus is a gyro that you attach to the Wii controller. This gyro gives the Wii controller one to one precision. Play Wii sports resort with the Wii motion plus, and you'll notice that the game behaves exactly as you'd expect. When you play the sword fighting game your character will move his sword exactly the same way you move your Wii controller. The only problems are lack of content for Wii motion plus, and it will cost you and additional $20 per controller. That's $20 more that you have to spend to get the Wii to do what it promised to do in the first place.

Nintendo's Wii has some of the most interesting content available on any console. Nintendo isn't playing to the hard core gaming crowd, and as a result they have taken a lot of chances by releasing some very unique content for their console. Perhaps the most surprising game to come out for Nintendo's console is Wii Fit. Wii Fit actually combines the Wii controller with a pad that has two weight scales. By using the Wii Fit pad and the Wii controller the game can tell you if you're in the correct posture.

The Wii has a whole slew of exclusive games built around the Wii controller. In fact most Wii games are exclusives. For the hard core gamer there are games like Metroid Prime 3, Zelda, Conduit, and Mad World. Unfortunately there aren't a lot of good hard core games, and the best hard core games cannot be found on Nintendo's Wii.

The Wii by and large ignores the hard core gamer crowd, but it offers up the best line up of casual games on any system. Moste of these casual games come in the form of party games. These are games that you can play with a large group of friends. Players can use the Wii controller to play through a slew of mini games. When played in a large group these games can be a lot of fun.

Nintendo also supports the Wii with its cast of strong exclusive titles. The Wii is the only system with Mario, Zelda, and Samus. Since the Wii doesn't focus on graphics Nintendo has taken a risk by reintroducing 2D platformers with their excellent New Super Mario Bros. game. New Super Mario may be based on an old formula, but it somehow manages to feel refreshing.

The Wii does support online play, but it does so very badly. Instead of creating an account with a friendly name, gamers are supposed to share a 16 digit friend code with each other. Honestly I've never even bothered to do this. Furthermore the Wii does not support in game or cross game chat. Playing games online with the Wii is a silent affair, and really something you'll be avoiding if you pick up the Wii.

Conclusion
Before you pick up a system you really need to examine the systems strengths. If you're a hard core gamer that prefers shooters, RPGs, and online game play then the Xbox 360 is the system for you. If you're a casual gamer that doesn't really play video games that much, then you should really consider the Wii. For me, I prefer the Xbox 360. The Xbox 360 is actually my favorite console of any generation. While I don't care to play the Wii that much I'm glad Nintendo took the risk and released the Wii. The Wii may not appeal to gamers like me, but its refreshing to see a company take some real risks, and in the process make video games more enjoyable for all of us.

Note: I didn't really review the PlayStation 3. This is because I just barely picked up a PlayStation 3, and I don't feel like I've had enough experience with it to comment on it intelligently. I will say this, thus far I've been very impressed with the PlayStation 3.

Monday, May 19, 2008

Dynamically Loading a Dll

The main purpose of this blog is to make a journal of common software problems that I have had to solve. As I've progressed through my career I've noticed that the same problems keep coming up, and I hate having to research out how to solve a problem that I've already solved.

This is my first entry. I have had to dynamically load dll's several times. .Net has tools for dynamically loading dll's, but since it something I only do one to two years, it's also something that I forget how to do.

The .Net Framework makes it easy to dynamically load a dll at run time, and instantiate classes inside of that dll. This is very useful when building a plug-in framework or a test harness framework.

In this posting I will create a rudimentary plug-in framework. This plug-in framework is intended only to demonstrate how to dynamically load a dll.

Our plug-in framework will dynamically load one or more dll's, instantiate objects inside of those dll's and forward commands to those objects. It is beneficial to have each plug-in implement a common interface, so our engine can communicate with our plug-ins through a contract. The following interface defines the contract between our plug-in framework and the plug-ins themselves.

public interface IPlugin{
//Retrieves the name for plug-in
string Name {get; }

//This method is called in order to allow the plug-in to execute its logic.
void Execute();
}

The above interface has Name property that will be used by the Plug-in framework in order to identify the plug-in to the user, and it has an Execute method that will be called by the framework in order to allow the plug-in to take over. This interface should typically be defined in a dll that contains all of the base plug-in interfaces and classes.

Now that we have our interface we can create our own plug-ins. We will create two plug-ins the first one will be called Fibonacci which predictably prints the Fibonacci sequence.

public sealed class Fibonacci : IPlugin{
public string Name {get {return "Fibonacci";}}

public void Execute(){
Console.WriteLine("Enter the number of fibonacci numbers you " +
"want to display.");
int sequenceSize = int.Parse(Console.ReadLine());
int currentNumber = 1;
int previousNumber = 0;
Console.Write("[");
for (int count = 0; count <>
Console.Write("{0}, ", currentNumber);
int tempCurrent = currentNumber ;
currentNumber = currentNumber + previousNumber;
previousNumber = tempCurrent;
}
Console.Write("]");
}
}

Now we'll make the second class. This class will be called Factorial, which will calculate and display the factorial of a number.

public sealed class Factorial : IPlugin{
public string Name{get{return "Factorial";}}

public void Execute(){
Console.WriteLine("Enter the number you want to take the Factorial of.");
int argument = int.Parse(Console.ReadLine());
int result = 1;
for (int multiplier=1; multiplier<= argument; ++multiplier)
result = result * multiplier;
Console.WriteLine("{0}! = {1}", argument, result);
}
}

Now that we've written our plug-ins we can write the engine. The engine will be a command line application that dynamically load all of the dll's in its plugin directory. The engine will then display the plug-ins and allow the user to choose which plug-in to execute. The user may quit the program by typing in the letter "q".

In order to facilitate the engine let's write some extension methods to aid us with reflection.

internal static class ReflectionExtensions{
public static object Instantiate(this Type type){
ConstructorInfo constructor = type.GetConstructor(new Type[]{});
return constructor.Invoke(new object[]{});
}

public static bool ImplementsInterface(this Type type, Type interfaceType){
Type[] interfaces = type.GetInterfaces();
return Array.Exists(interfaces, candidate => candidate == interfaceType);
}
}

Now let's implement the Main class:

public class Main{
private static string _pluginDir;
public static void Main(){
//Load the assemblies.
_pluginDir = Path.Combine(
Application.StartUpPath,
"Plugins");

IEnumerable plugins =
from dll in Directory.GetFiles(_pluginDir, "*.dll")
let asm = Assembly.LoadFromFile(dll)
from type in asm.GetTypes()
where type.ImplementsInterface(typeof(IPlugin))
select type.Instantaite() as IPlugin;

ExecuteEngine(plugins.ToArray());
}

private static void ExecuteEngine(IPlugin[] plugins){
string userSelection = string.Empty;
do{
for (int index = 0; index <>
Console.WriteLine("[{0}] {1}", index, plugins[index].Name);
}
Console.WriteLine("(Q)uit");
userSelection = Console.ReadLine();
int pluginIndex = 0;
if (int.TryParse(userSelection, out pluginIndex){
IPlugin selectedPlugin = plugins[pluginIndex];
selectedPlugin.Execute();
}
}while(userSelection.ToUpper() != "Q");
}
}

The above code is close, and it will certainly work with the plug-ins we've created. Unfortunately this code will only work with simple plug-ins like the ones we've created. The problem is the .Net framework for one reason or another has problems resolving Assemblies referenced by dynamically loaded Assemblies. In order to get around this you need to help the .Net framework resolve the assemblies referenced by your dynamically loaded assemblies. You do this by subscribing to the current AppDomain's AssemblyResolve event. The following code demonstrates how to do this:

public class Main{
private static string _pluginDir;
public static void Main(){
AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly;
//Load the assemblies.
_pluginDir = Path.Combine(
Application.StartUpPath,
"Plugins");

IEnumerable plugins =
from dll in Directory.GetFiles(_pluginDir, "*.dll")
let asm = Assembly.LoadFromFile(dll)
from type in asm.GetTypes()
where type.ImplementsInterface(typeof(IPlugin))
select type.Instantaite() as IPlugin;

ExecuteEngin(plugins.ToArray());
}

private static void ExecuteEngine(IPlugin[] plugins){
string userSelection = string.Empty;
do{
for (int index = 0; index <>
Console.WriteLine("[{0}] {1}", index, plugins[index].Name);
}
Console.WriteLine("(Q)uit");
userSelection = Console.ReadLine();
int pluginIndex = 0;
if (int.TryParse(userSelection, out pluginIndex){
IPlugin selectedPlugin = plugins[pluginIndex];
selectedPlugin.Execute();
}
}while(userSelection.ToUpper() != "Q");
}

private static Assembly ResolveAssembly(object sender, ResolveEventArgs e){
string[] dlls = Directory.GetDirectories(_pluginDir, "*.dll");
string asmFile = Array.Find(
dlls,
candidate => AssemblyName.GetAssemblyName(candidate).Fullname = e.Name);
return Assembly.LoadFile(asmFile);
}
}

In the above example we subscribed to the current AppDomain's ResolveAssembly event. The .Net framework will call our ResolveAssembly method whenever it cannot resolve an Assembly itself. We look into the plug-in directory for the assembly, by searching for a dll that has the same Assembly name as the one passed in by the framework. Now our plug-in application should work. (Note: I actually haven't been able to run the current code through a compiler, so it actually probably doesn't work. I'd be shocked if it even compiled at this point. I'm downloading the compiler now and I will verify that this code is correct once it is installed.)