"You must unlearn what you have learned."
Yoda to Luke Skywalker, Empire Strikes Back 1981
I have become convinced that we are entering a new dawn of software development and we must take time to unlearn that which we know. Over the last two months I've researched building business applications using Silverlight 2.0. In case you don't know, Microsoft released Silverlight 2.0 to help developers build Rich Internet Applications (RIAs). Silverlight 1.1 (released in 2007) gave us a small glimpse of the future of RIA development. That glimpse proved that Silverlight 1.1 lacked too many critical features for business developers (it didn't even have a button). Silverlight 2.0 (released in March 2008 at MIX 08 in Las Vegas, NV) is a different story. It has all of the features a business developer might need. The control set includes: textboxes, buttons, watermark textboxes and-drum roll please-a DataGrid component.
During my research, I experimented with the DataGrid. I started (in XAML) adding columns to the DataGrid's columns collection, setting data binding attributes, column widths, and header properties. I then turned to the code portion of my research and DataGrid's ItemSource
property to a list of objects. I ran the application and lo-and-behold it worked (not the first time of course, but
eventually (). After getting my simple grid demo working I wanted to implement a simple, but common use case. I wanted to allow the user to sort the data by clicking on the column. Here's how it went:
I struck out on all accounts. I thought I'd have to wait for a new rev for this feature. I did take one more step though. I turned to my trusty search engine Google and typed in “silverilght 2.0 datagrid sort”. And look what I found: Matt Berseth (http://mattberseth.com/blog/) had already figured this out in a very creative and enlightening way. Matt's unique solution puts a HyperlinkButton control into the DataGrid's Header Content
property, which is defined as Object. Normally you'd use this property to specify a string as your header. But in Silverlight, when a property says it's an object, it's an object. This means you can replace the header content with a hyperlink rather than a textbox. My epiphany occurred here.
My typical path took me to the control itself-I searched for properties, events, and even considered for a moment hacking up a hit test set of code to do this. It hadn't occurred to me to composite some controls together to do what I wanted. This is where I told myself I must unlearn what I know. I must think of new and interesting ways to combine these controls to do new and interesting things.
This epiphany raised its head again two weeks ago. Over the last six months a client I work with has started the trek down the Agile Development path, which included installing and researching agile development applications including: Nant, Nunit, and Subversion. My client uses Nant and Nunit to automate their testing, and in the last two weeks they moved a large quantity of source code into a Subversion repository. This last application has provided me with another epiphany. Source code control in Subversion is “just different” than in Visual SourceSafe (our previous source code provider). Visual SourceSafe is a pessimistic version control system (you lock
files when you check them out). Subversion is just the opposite. All
files are worked on in shared mode. Meaning two developers can work on the same
file at the same time. It's up to the developer to merge changes into the development branch of code when conflicts occur. Along with a different philosophy, Subversion uses different terms. In Subversion, Checkout means get a fresh set of code from the repository; Import means send source code to the repository. Commit means send your changes to the repository. Visual SourceSafe had different meanings for all of these terms, and we needed to change how we think in order for the project to go forward.
When I started using Subversion, I found it difficult until I told myself what Yoda said: “You must unlearn what you have learned.” I closed the book on Visual SourceSafe and opened a new one on Subversion. I consulted the documentation to see what the Subversion philosophy is and what the terms in Subversion really mean. When I “forgot” what I knew about source code control from the VSS point of view, things began to become clear and the process of migrating became much simpler.
In today's development world, new technologies require new thinking. You need to unlearn what you already know. To find comfort in the unlearning process, take shelter in the words of Jedi Master Obi-Wan Kenobi to Luke Skywalker: “Luke… Let go. Trust the force”.