Marquee de Sells: Chris's insight outlet via ATOM 1.0 csells on twitter

You've reached the internet home of Chris Sells, who has a long history as a contributing member of the Windows developer community. He enjoys long walks on the beach and various computer technologies.




Visual Studio 2005 Linux Edition

"I first heard about it at a Seattle area Starbucks. I mean, I was just like sitting there drinking my Venti no-whip triple shot soy latte and I looked over at this dude sitting next to me who was working on a laptop and I saw something on his screen. So I said "Dude is that the new version of Eclipse?" and he said "No, it's Visual Studio 2005 Linux Edition". Then he typed a few lines of code and created an Indigo service that runs on the Apache web server. I was like "Dude!" and almost spilled my latte."
--Anonymous Seattle Youth

"We still believe that Java is a strong language for development. However, we will no longer continue to build on that technology preferring instead to move developers to .NET."
--Anonymous Sun Representative

0 comments




Viva la IDL!

I'm sure you've heard the uproar about "saving VB6" by now. Since I'm not a member of the VB programmer community, I don't feel qualified to judge them, their tools or their plight.

However, I am a charter member of the COM community, so when I hear about Microsoft's plans to halt the support for IDL, I get burning mad! Save IDL! Sign the petition! Viva la IDL!

0 comments




My First New Job at Microsoft

Today's my last day at MSDN. I will no longer be content strategizing for Longhorn/WinFX or smart clients or acting as liaison between marketing, evangelism and the product teams internally and developers externally. And I'm really going to miss it. MSDN took a flier on me being a successful Microsoft employee in a culture that doesn't much like remote folk and made a very comfortable home for me. I could've gone on for a long time in that role.

Still, I felt another calling. At Microsoft, it seems like all of the action is with the product teams. To come to Microsoft as a software engineer and not work on a product team seemed like starting with the Yankees but never getting out of the dugout.

So, on Monday, I start in DSG (the Distributed Systems Group) aka the team that owns Indigo. I'll be "are looking at ways to extend the notions of modeling that we've incorporated deeply into the stack and make them more general" (or so my new boss says). I can't tell begin to describe how lucky I feel. Not only do I get to be on a real product team, still mostly from my house in Oregon, but I get to work on a very juicy problem. Further, I get to do it with Oliver Sharp, one of the prime movers on the Indigo team, along with a growing group of other people way smarter than I. It reminds me of the heyday of a certain training company with which I once had a deep relationship.

Two weeks ago, Oliver sent me a list of 10 fun computer sciency things to dig into that could take months. Last week I was helping the team get ready for a BillG review. This week I was trading emails with the team and a Sr. VP on the direction of the market and how it affects our product plans. Is this what it's like for an addict that's given up their habit to take it up again? If software engineering is wrong, I don't want to be right! : )

0 comments




sellsbrothers.com needs an intern!

I am completely swamped this year and sellsbrothers.com needs a serious upgrade, so, I'm looking for one or more interns interested in the following work:

If you're interested, drop me a line (I'm sure I'll be flooded... : ).

0 comments




Avalon is changing my thinking...

Here. This application demonstrates the two things I'm finding that Avalon has changed about my thinking. The first is that data binding makes itself into even trivial Avalon applications and its presence is appreciated. The second is that I want to push as much stuff into XAML as I can. Keeping the data separate from the code makes a bunch of sense and, for my trivial application, keeping the data inline with the rest of the UI was very useful. It allows for easy maintenance and localization while pushing as much of my application into declarations and out of imperative statements. The more I can tell the computer what I want instead of how I want to accomplish it, the better off I am.

0 comments




Leaders and Legacy

Here. For an internal thingie, I was asked to write a short bio, define what I think a "leader" is, describe my target legacy and list my biggest source of pride. This is what I came up with.

0 comments




The *Official* Place for Avalon and Indigo Bugs!

What with the public availability of the Avalon and Indigo CTPs and our stated goal of pre-beta bit releases to gather feedback, you might wonder, "But where should this feedback go?" I'll tell you where to go -- the MSDN Product Feedback Center, which now has entries for Avalon and Indigo. Hog pile on the WinFX API product teams!

0 comments




Another Laugh Out Loud TechEd Video

Scott and Rory do it again.

0 comments




Leaders and Legacy

For an internal thingie, I was asked to write a short bio, define what I think a "leader" is, describe my target legacy and list my biggest source of price. This is what I came up with:

I've been pretty much everything you can be in the IT industry including author, speaker, consultant, conference organizer, grunt in a start-up, CEO in a start-up, developer, tester, documenter, etc. I'm currently a content strategist for MSDN in the areas of WinFX/Longhorn and smart clients. I'm passionate about building products to make people happier, whether that's because they're more productive or because I've solved some hard problem or just because they lean back and say "cool!" My biggest regret is that I've never yet been on a product team at Microsoft; to get the full experience, someday I need to do that! After that, I can retire and write novels from coffee shops around the world. : )

A great leader is someone that inspires you to do things you didn't even know you were capable of doing.

The legacy I'd like to leave behind is that people can look back at their interactions with me and think that I helped make their lives better, whether it was an answer to a tough question or an insight that they hadn't had before or a comment that tickled their funny bone.

The biggest source of pride in my life is the family I've built with my wife and two sons (the Sells brothers, whence the name of my web site came: www.sellsbrothers.com).

0 comments




I can feel Avalon changing me...

I'm writing a tiny little application for my writing on ClickOnce in Avalon. In fact, to demonstrate ClickOnce, the app hardly matters, so I picked something really simple: an excuse generator. I didn't even have to make up the excuses, as I stole them from an office gag gift two years ago and wrapped them in an excuse web service (which is a whole other story : ).

Binding to Data Defined in Code

The idea was to have an array of excuse strings like so:

public partial class Window1 : Window {
  static string[] excuses = {
    "Jury Duty",
    ...
    "It's Not My Job",
  };

public Window1() {
    InitializeComponent();
    this.DataContext = Window1.excuses;
  }
  ...
}

Once I had the collection of strings, I make them available for binding by setting them to the DataContext of the main window and the rest of the code would simply be a matter of binding a TextBlock to the current excuse like so:

<Window ...>
  ...
  <TextBlock TextContent="{Bind Path=/}" />
  <Button x:ID="newExcuseButton">New Excuse</Button>
  ...
</Window>

By binding the TextContent property of the TextBlock to a Path of "/", I'm explicitly saying "don't try to dig into each object in the collection looking for sub-properties, but binding to the item itself." Initially, the TextBlock will show the first item in the list:

When the button is pressed, I change the output by selecting a random item from the collection and setting it as the "current" item in the collection:

Random rnd = new Random();
void newExcuseButton_Click(object sender, RoutedEventArgs e) {
  ListCollectionView view =
    (ListCollectionView)Binding.GetDefaultView((IEnumerable)Window1.excuses);
  view.MoveCurrentToPosition(rnd.Next(view.Count - 1));
}

By grabbing the view for the excuses collection, I can do a number of things with it, including move the current item in the view to some specific position. When I do that, the data bound TextContent property of the TextBlock will be updated to show whatever is current:

So here's the first thing that I'm notice that I really approach differently in Avalon: the data binding hammer is almost always the first tool I reach for in the programming box. In the old days, to write this app, I'd set the TextContent property directly in code. Now, I don't even think to do that. Instead, I've got data and a property to set, so that's data binding.

Binding to Objects Defined in XAML

"But wait!" I hear you howl. "What about internationalization?!?" I know. Hard-coded data in the source code is a bad idea. So where does it go? Into the XAML itself, of course, so that anyone working on the UI, whether for an English-speaking country or not, can add new items, port them to another language, etc. How to do it? Well, since XAML is an XML dialect for describing object hierarchies, I could define a new type (roughly):

class Excuse {
  string value;
  public string Value { get { ... } set { ... } }
}

class ExcuseData : List<Excuse> {
}

Then I could write my excuse data as a hydration of objects using the ObjectDataSource (roughly):

...
<Window.Resources>
  <ObjectDataSource x:Key="ExcuseData">
    <l:ExcuseData>
      <l:Excuse Value="Jury Duty" />
      ...
      <l:Excuse Value="It's Not My Job" />
    </l:ExcuseData>
  </ObjectDataSource>
</Window.Resources>
...

The XAML inside the ObjectDataSource will create an instance of the ExcuseData type, adding an object of type Excuse for each <Excuse> element, setting the Value property of the object using the Value attribute from the XAML. With the object data source, I can create a little "data island" in the middle of my app where the list of excuses can be poked and prodded without touching the code.

Binding to Data Defined in XAML

Still, why go to the trouble of defining my own custom data type, which doesn't have any behavior to speak of, when I've got the universal behavior-less data type -- XML? I can use the XmlDataSource without any custom type at all:

<Window.Resources>
  <XmlDataSource x:Key="ExcuseData" XPath="/Excuses/Excuse">
    <Excuses xmlns="">
      <Excuse>Jury Duty</Excuse>
      ...
      <Excuse>It's Not My Job</Excuse>
    </Excuses>
  </XmlDataSource>
</Window.Resources>

You'll notice that the XML looks almost exactly like the object data source, except that instead of using an attribute to keep the juicy bits, I use the content area itself to store the data, very like the initial array example (I could have used XML attributes, but it seemed overkill in this case). One other interesting bit is that XPath of the XML data source itself. It defines the bit of the data island from which I'm pulling the data. If I had used /Excuses, the data collection would have had a single item with a bunch of children. But using /Excuses/Excuse, I'm exposing the children directly.

To use the XML data source, I need to set it as somebody's data context in the hierarchy of controls and bind to it:

<Window ...>
  <Window.Resources>
    <XmlDataSource x:Key="ExcuseData" XPath="/Excuses/Excuse">...</XmlDataSource>
  </Window.Resources>
  <Grid ... DataContext="{Bind DataSource={StaticResource ExcuseData}}">
    ...
    <TextBlock ... TextContent="{Bind XPath=.}" />
    <Button ... x:ID="newExcuseButton">New Excuse</Button>
  </Grid>
</Window>

I should note that in future bits, I'll be able to set the grid's data context to {StaticResource ExcuseData} directly, but in the March 2005 CTP Avalon bits, I have to actually bind the data source to the data context in a double bind that blows my mind.

More importantly, notice that instead of using a Path to get to the data I want, I use an XPath. This allows me to further refine the XPath statement provided as part of the XML data source itself. However, since I don't want to refine it any further, I use the XPath statement that says "just use the content of each of the elements." You'll notice that I used "." in the XPath statement to provide this meaning instead of "/" as I did in the case where I was using an object Path. The two syntaxi look the same, but are very different and you'll want to watch yourself switching between the two.

Anyway, with the data moved to the XAML along with the UI and the binding logic, my actual code boils down to only the following:

public partial class Window1 : Window {
  Random rnd = new Random();

  public Window1() {
    InitializeComponent();
    this.newExcuseButton.Click += newExcuseButton_Click;
  }

  void newExcuseButton_Click(object sender, RoutedEventArgs e) {
    IDataSource dataSource = (IDataSource)this.FindResource("ExcuseData");
    ListCollectionView view =
      (ListCollectionView)Binding.GetDefaultView((IEnumerable)dataSource.Data);
    view.MoveCurrentToPosition(rnd.Next(view.Count - 1));
  }
}

So, this is really only a few lines of code, one to hook up the button event handler, one to find the excuse data from the window resources, one to get the view on the excuse data and one to move the currency pointer to some other random spot. The actual display of the data is left to the data binding code (which somebody else gets to maintain).

One other thing worth noting is that I had defining event handlers in the XAML. Even when it's me writing both the XAML and the code, I don't like the XAML making demands on the code. If the XAML handles an event, e.g. with an event trigger, than that's fine, but don't make requirements of the code form the XAML. Instead, provide hooks for the code to do its work, e.g. the x:ID on the ExcuseData and the TextBlock are both used in the code, but neither requires anything of the code. If you're going to separate the presentation from the logic, this is the kind of thing you'll want to think about.

Where Are We?

Two things I'm finding that Avalon has changed about my thinking. The first is that data binding makes itself into even trivial Avalon applications and its presence is appreciated. The second is that I want to push as much stuff into XAML as I can. Keeping the data separate from the code makes a bunch of sense and, for my trivial application, keeping the data inline with the rest of the UI was very useful. It allows for easy maintenance and localization while pushing as much of my application into declarations and out of imperative statements. The more I can tell the computer what I want instead of how I want to accomplish it, the better off I am.

0 comments




Translate C# To And From VB.NET As You Type!

Carlos Aguilar Mares, an SDE on the MS Web Platform & Tools team, has created a fabulous C# to/from VB.NET code translation tool. You can hand it a file and translate in batch mode or you can just type in one language and see it translated in real-time into the other. Now all Carlos needs is a project-wide batch mode and he'd have the problem licked!

0 comments




Betsy's Got Them GotDotNet Blues

Betsy Aoki, the matriarch of GotDotNet, sings a song of GDN Blues. And not only did she write and sing the song (with a surprisingly good voice for a geek), she also had a hard time getting it published across all GDN servers, further illustrating the point. Recommended!

0 comments




La Vida Robot

This story of a set of illegal alien high school students from the wrong side of the tracks in Phoenix competing against MIT college students was heart warming and heart breaking at the same time.

0 comments




Steve Maine on Indigo Duplex Contracts

Steve Maine of Brain.Save() has done a really good job on the description of a set of duplex contracts in Indigo, i.e. those contracts where callbacks are specified, using the design of a multi-player game of blackjack. Steve shows the service contract interfaces, a bunch of the messaging code and even what's on the wire. Recommended.

0 comments




March Avalon/Indigo CTP Available for Public Download

It took a coupla days more than we wanted 'cuz I was fighting with some internal tools, but the March 2005 Avalon/Indigo CTP is available for public download.

Make sure you follow the instructions on the download page and only use it with the February CTP release of Visual Studio 2005, i.e. don't use it against the Whidbey beta 2 that'll "coming soon*" to a theater near you.

* for some definition of "coming soon..."

0 comments




1960 older posts       675 newer posts