Rod Paddock

Sponsors

The Lounge

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Unlearn

“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 2 months I have been researching building business applications using Silverlight 2.0. In case you don’t know Silverlight 2.0 is a tool used to build Rich Internet Applications (RIA’s) Silverlight 1.1 (released in 2007) gave us a small glimpse of the future of RIA development.  This glimpse proved that Silverlight 1.1 was wholly lacking for business developers (it didn’t even have a button). Silverlight Version 2.0 (released at Mix 08 in Las Vegas, NV) is a different story. Silverlight 2.0 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 began experimenting 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:

1. Look for DataGrid properties called something like “AllowSort”
2. Look for header properties that would turn this feature on.
3. Look into the documentation for the DataGrid (samples, online, etc)
4. Download and open the source code for the DataGrid (yup you read that right its available to developers)

I struck out on all accounts. It looked like I would be waiting 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 was to put a HyperlinkButton control into the DataGrid’s Header Content property. The Header object’s Content Property is defined as Object. The normal use case for this property is to specify a string as your header. But this is Silverlight and 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. This is where my epiphany occurred:

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 over the last 2 weeks. Over the last 6 months we have started the trek down the Agile Development path. This path has included installing and researching agile development applications including:  Nant, Nunit and Subversion.  We are using Nant and Nunit to automate our testing, and in the last two weeks we moved a large quantity of our source code into a Subversion repository. It’s this last application that 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.

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 POV things began to become clear and the process of migrating 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”. 

crossposted from blog.dashpoint.com

Posted Fri, May 9 2008 6:37 AM by Rod Paddock [MVP]

[Advertisement]

Comments

Ray wrote re: Unlearn
on Fri, May 9 2008 11:51 AM

Nice article Rod.

P.S. Somehow it got messed up into a wall of text - without any paragraphs in the RSS (Google Reader) :-(

Rod Paddock [MVP] wrote re: Unlearn
on Fri, May 9 2008 11:55 AM

I noticed that right after I postd it. I went back and fixed it. So hope it looks better now that I cleaned it up.

Kyle Peterson wrote re: Unlearn
on Fri, May 9 2008 12:53 PM

May I refer you to zen story number 1 from "101 Zen Stories":

A Cup of Tea

Nan-in, a Japanese master during the Meiji era (1868-1912), received a university professor who came to inquire about Zen.

Nan-in served tea. He poured his visitor's cup full, and then kept on pouring.

The professor watched the overflow until he no longer could restrain himself. "It is overfull. No more will go in!"

"Like this cup," Nan-in said, "you are full of your own opinions and speculations. How can I show you Zen unless you first empty your cup?"

Evan wrote re: Unlearn
on Fri, May 9 2008 2:01 PM

For what it's worth, the initial version of silverlight was really only targetted at big streaming media sites (ie..streaming video).  The thought was to ship something really small and get it running on some big, high traffic sites (ie..mlb.com for video).  This kicks the end-user adoption cycle into high gear while the bells and whistles are built for business app developers.  When our tools are ready to go, they will already have some type of installed userbase in the wild.

Or so it was explained in a Channel 9 video. :-)

Bryan Reynolds wrote re: Unlearn
on Fri, May 9 2008 8:28 PM

I had my epiphany while reading "Windows Presetation Foundation Unleashed" by Adam Nathan.

Great book

Scott Bellware wrote re: Unlearn
on Sun, May 11 2008 12:15 AM

The verbiage changes again when you switch to Git :)  The important thing is to continue choosing the best possible tools and accept that the learning curve is infinite.

Jonathan Parker wrote re: Unlearn
on Sun, May 11 2008 12:13 PM

Yep, SVN needs shelved checkins.

In regards to unlearning if you've done the unlearning necessary to grok TDD then you'll be fine with Silverlight.

steven wrote re: Unlearn
on Mon, Mar 9 2009 8:46 PM

Thank you

?

Add a Comment

(required)  
(optional)
(required)  
Remember Me?