spout

January 15, 2004 spout

Bush: Get Your Own Dream!

Here.

It bugs me that Bush would steal JFKs dream of getting off of our planet, especially after we’ve already done it. Why not reach for getting America off of foreign oil by developing alternative energy sources, freeing us from the need to screw around with other countries and making us targets for terrorism? That’s a cool dream. But noooo, you can’t do that one, because you’re just a shill for US big oil!

Sorry about that… I now return you to your regularly scheduled programming.

January 9, 2004 spout

Surprised by Microsoft’s Openness

Here. The one where even I'm surprised at how open Microsoft is willing to be.
January 9, 2004 spout

Surprised by Microsoft’s Openness

Friday, January 9th, 2004

I get a lot of emails from folks surprised about how open Microsoft is being lately, mostly due to all of the blogging we’ve been doing lately (some of us started long before we ever became employees). However, even I was surprised in an internal blogging meeting today filled with a bunch of MS bloggers. During the meeting, we talked about a bunch of the benefits to MS and to our customers. Sara talked about how blogs are driving more traffic to MSDN than our own headlines. Robert described his green, yellow, red” scale for determining whether to blog about something (believe it or not, he does decide not to sometimes : ).

And then Adam Sohn from marketing talked about the need to police ourselves, describing some of the downsides in regards to blowing some group’s launch plans or unconstructively criticizing another group. He preached caution when approaching the line between what was good for the customer and what was good for Microsoft. After listening to what I began to interpret as a message of self-censorship, I asked Adam a warm up, Isn’t it true that a lot of the stuff close to the line’ is what our customers find most valuable?” He agreed that it was. And then I asked Adam my real question, So, when we get close to that line, do we err on the side of our customer or ourselves?”

Now, you have to remember that I’ve been a contributing member of the Windows development community for a lot of years. I’ve seen how aggressive Microsoft is in everything it does to always be on top. So when I asked on what side of the line I should come down, I fully expected to be told to keep the shareholders in mind.

Of course, you know what his answer was or this story wouldn’t have made it into my blog until after my tenure at MS was complete (or just before : ). He said, without hesitation, Err on the side of the customer.”

That blew me away. Of course, I’ve been doing just that since before I became an MS employee and Robert rides the ragged edge all day long, but it was *very* nice to hear that guy with the PR and legal battle scars tell me to keep the customer first and foremost in my mind.

Thanks, Adam. You’ve confirmed my decision to work at Microsoft.

January 3, 2004 spout

On Genghis, WinForms and How to Move Towards Avalon

Saturday, January 3rd, 2004

Inspired by my pending interview of Don Box, Paolo Severini sent along an interview for me.

Paul: Being a faithful reader of your books, articles and of your blog, I’d like to ask you a few questions about LH, Avalon and the future of WinForms. Before all, let me say that I’m really fascinated by Longhorn, and especially by Avalon. I installed the PDC stuff as soon as I received it through my MSDN subscription and I’ve begun exploring it with pure geek” enthusiasm. Everything is extremely interesting, but I’m now not sure what to do with it.

Chris: I know what you mean, Paul. I’m going through that myself. Suddenly having so many fewer barriers tends to throw off the engineer in me. I’m working through it by begging the Longhorn User Experience team for guidance, learning Adobe Illustrator, reading graphic design books and trying to open my mind to the graphic designer inside us all (I hope : ).

Paul: Paraphrasing one of the questions you proposed to Don Box: what should a WinForms programmer *really* do today to prepare for Avalon?

Chris: If you want to write code today that’ll work well on Longhorn tomorrow, write WinForms today. WinForms in Whidbey gets tons more features and I expect they’ll be some cool new Longhorn-specific stuff when the time is right. If, when you’re preparing a Longhorn version of your application, you’d like to host Avalon controls from your WinForms app or even build Avalon apps that host your WinForms controls, you’ll be able to do that in Longhorn via WinForms/Avalon interop.

For maximum flexibility in the code you write now, be very thorough about separating the data from the view of the data so that you can write a 100% Avalon front end to replace your WinForms front end if such is your need. Likewise, be very thorough about separating the data from the storage of the data is that you can take advantage of WinFS.

Paul: I’m very grateful to MS for having disclosed their future technologies so soon, and more generally, to have become so opened” to outsider’s eyes, with so many devs and PMs now blogging about their work.

Chris: Me, too. Without this openness, I’d get into lots more trouble. : )

Paul: But I somehow also think that maybe LH was presented a bit too soon. Since it’s not planned to be released before 2006, chances are that the shipped version could be significantly different. (Will it? Is it already? Can you write anything about that? :-).

Chris: I used to think that we were unveiling Longhorn too soon, too. However, the later in the development process we get it out to reviewers, the fewer major changes we’ll be able to make based of your feedback. What that means, of course, is that some major things are going to change between now and release, but those changes will be based on decisions that include feedback from you. The downside is that you’ll have to relearn some of the things you learn with these bits. Hopefully, the upside is that most of what you have to unlearn will be replaced with something significantly better.

Paul: Furthermore, even when the new presentation subsystem will ship, it seems like it won’t be easy to write code that supports both the new and the old platforms, being they so different, and that could slow down its widespread acceptance even more. So I’m afraid that we’ll all have a difficult time writing user interfaces, having to decide whether to take advantage of the new features or simply stay with the old portable libraries. After all, there are today still (too many) people running Windows 9x. And Windows XP is such a great OS that won’t universally be replaced so soon.

Chris: I’ve already mentioned how well WinForms will work under Longhorn, so I think I’ve answered part of your question. However, you’re asking something deeper here, i.e. when do I give up the old way” that has more ubiquitous support for the new way?” In this case, you’re talking about .NET and Longhorn, but you could as easily be talking about DOS and Windows or Win32 and .NET. This is the eternal struggle and the reason that we need software engineers in the first place. As with all such questions, the answer is it depends.”

My general purpose answer is to always pick the newest thing that meets my requirements. The newer the technology you pick, the longer the shelf life. Can I build cool, scalable apps that take advantage of the high resolution monitors and GPUs of tomorrow in DOS? Absolutely. Do I want to? Hell no. Can I do it in WinForms? Yes, although it’ll still be harder than doing it on Avalon. Will I increase my available market by targeting DOS today? The answer used to be yes,” but for a while now it’s been no.” What about WinForms? The answer is definitely yes” today and will be for a while yet, even after Longhorn ships.

The answer to the question of when to adopt new technology has too many variables for me to provide any general advice better than as soon as possible.” Of course, Microsoft wants the answer to that question to be sooner rather than later,” and we’re working to make Longhorn kick-ass for developers, business users and consumers so that ubiquity is taken out of the equation as soon as possible. Please use all channels of communication you have into the company to help us make sure we’re doing that. The WinFX newsgroups are one good place for such feedback. They are heavily monitored by all of the WinFX teams and the Longhorn User Experience (Aero) Team.

Paul: I found out that the PDC build of Avalon doesn’t really work in kernel mode but simply uses two (unmanaged) DLLs, milcore and milrender built upon the old GDI APIs (to the point that it is actually possible to run Avalon on XP). Of course, that’s bound to change, as Chris Anderson wrote, with the new video driver model and when the desktop composition stuff will get turned on. But wouldn’t it be nice if a subset of Avalon ran on XP? After all, not every app will take advantage of its more advanced features.

Chris: Before I answer this question, I just wanted to point out that GDI is not part of the Avalon rendering path. Instead, Avalon is built on DirectX, which is built directly on the drivers. GDI is still supported, of course, but it’s a parallel rending path to Avalon’s.

The answer to the core question, i.e. why not ship Avalon on XP, is one of resources. Chris Anderson once told me that something like a man millennia has gone into the development of Avalon thus far. Even if Chris was exaggerating for effect, that’s still one hell of a lot of work. That work has gone into building an architecture that allows application developers to take advantage of features present all the way down to the hardware level, including changes at every point in the presentation stack. What kind of work do you think it would take to make a subset of that available under Windows XP? Or Windows 2000? Or Windows 98? What kind of work do you think it would take to support those features on those down-level operating systems in their subsetted states? If we’re looking at a release years into the future already, how many more years are we willing to wait to release Avalon in a form that works in a subsetted form on those OSes? And what will we ship to our customers expected a new OS in the meantime?

It may be that you could come up with answers that you love to these questions. Would our other customers answer them the same way? Would our shareholders answer them the same way? Would your answers best position us against our competitors?

Even if you got a subset of Avalon that works across .NET platforms today, would it really enable you to be more successful at your business or is it an engineering gosh that’d be neat?”

I know that our product teams really listen to our customers these days, so if you’ve got specific scenarios that you need enabled to be successful, please let them know.

Paul: Furthermore, if XAML is, in the end, only a way to glue together a graph of CLR objects, why don’t use it also to build WinForms UI? Both these options would make the transition much easier.

Now that’s a question I can provide a more satisfactory answer to, I think (sorry about that last answer : ). In the Longhorn PDC bits today, you can generate WinForms apps using XAML for the very reason you state. Likewise, if you’d like to try a subset of XAML in today’s version of the .NET Framework, there are not one, but two 3rd parties providing early access to projects to allow this to happen. Given the amount of work that has gone into, and will go into, getting Avalon out the door, I doubt very much that their versions of XAML will be full-featured, but it may help ease the transition, as you say.

Paul: That brings me to ask you about the future of WinForms (about which I’m now reading your book and really enjoying it). In the near future I will surely have to write WinForms code. But is it still worthwhile to spend time studying and trying to improve it? (I personally think so). Or should I rather concentrate my interest learning everything about the new LH technologies? So I’m back on the question about how to prepare for Avalon…

Chris: I’d say that it absolutely makes sense to continue to write WinForms applications for years to come. Not only in WinForms a great platform for client applications today, but in Whidbey, it about doubles in size and capability. Plus, WinForms applications will continue to work great under Longhorn and will form the core of an application that needs to take advantage of Longhorn features under Longhorn but continue to work on the rest of the .NET platform. Unless you are planning to target only Longhorn, WinForms is absolutely where you should be spending your client development effort today and for years to come.

Paul: Speaking of WinForms, one of the things I’ve never liked is the absence of windowless controls. It has been said that windowed and windowless controls are difficult to make live together, and that’s true. But windowless controls are sometimes very useful (and cool! just think to the Windows Media Player UI). I found in your Genghis page that the Windowless control architecture” feature is still opened” and I’d like to try to work on it. (In the past, I wrote an ActiveX control container that supported windowless controls, so I wouldn’t start from zero).

Chris: Windowless controls were meant mostly as an optimization when creating thousands of Window handles brought the platform to its knees. Some folks also used windowless controls as a good way to fake non-rectangular controls. In modern implementations of User32, neither is much of an issue, so windowless controls provide a service that is no longer required in most cases. In the specialized cases where it is still necessary, I find that building an aggregate control that does the drawing of multiple controls that you would have made windowless in the past solves most of my needs in this area, although your mileage may vary. Given that Genghis has most of the rest of the features that I wanted for it, but no windowless control architecture, I’d say that folks seem to agree with me that windowless controls are no longer as important as they once were.

Paul: But I also noticed that the Genghis project has been still for a few months, so I’m now wondering if it is still alive and if my project still makes sense now that Avalon is on its way. May you give me an advice?

Chris: I was waiting for a wizard that would generate MDI, SDI and multi-SDI applications before shipping the next drop of Genghis, but there are enough new things and fixes that we should have another version of Genghis out in a week or so. If you or anyone would like to build the wizard (or just send Scott Densmore email begging him to finish the one he already started and has promised to me several times) that’d be great.

Thanks for your wonderful job and for the time you dedicated to this mail. I just hope my English was understandable… :-)

Best regards from Italy,
Have a wonderful new year!
–Paolo Severini

December 24, 2003 spout

Lending a Helping Hand

Here. Normally I wouldn't pass along something like this, but this is from my uncle and therefore genuine. If you can lend a hand to his brother who's financially destitute after a liver and kidney transplant, I'd appreciate it. Even prayers would help. Thanks!
December 23, 2003 spout

Lending a Helping Hand

I know this sounds like spam, but it’s not — it’s from my Uncle Mark, who’s also my godfather and the nicest man I’ve even known:

Chris, I’m writing you to ask your help. My brother Tom was gravely ill. Tom is 55 years old, married with two grown sons. He needed both a liver and a kidney transplant. He just received his transplants. It was by the grace of God just in time as he was within 2 to 3 days of death. He is doing well with no signs of rejection and just some minor complications. Unfortunately, he is nearly bankrupt from all his medical bills. Tom’s life has been marked by several challenges, many overcome through hard work and determination. He is a man of immense spirit and we all love him dearly. This is a challenge he can’t face alone. As you can imagine, our family is very concerned. We pray a lot. We have also undertaken a benefit and raffles for him to help him with his expenses. Right now we’re just trying to help him pay his mortgage and put food on his table. He hasn’t been able to work for three months. He also faces a tremendous bill from the transplant that his health insurance won’t pay.

There are five courses of action I’d like you to consider. First of course is I’d appreciate your prayers for my brother Tom that he continue to recover his health and his finances. The next four things I am asking for is your support of our raffles and benefit.

I would like you to consider purchasing a ticket for what we call the Big Money Raffle”. There will be a limit of 110 tickets sold. First prize is $2000. Second prize is $1250. Third prize is $750. There will be an additional ten $100 winners. Odds of winning some prize are 13 in 110. 3 in 110 chance of bettering your bet. 1 in 110 of winning the top prize. Tickets cost $135 apiece. Much better odds than the lottery. Drawing 1/11/04.

Also available are Quilt tickets at $1 apiece. My sister made the Queen size quilt. Value is somewhere between $1000 and $1500. Drawing 1/11/04.

The third thing I’d like you to consider is if you know anyone among your connections in the computer world who might also like the opportunity to purchase Big Money” and Quilt” raffle tickets. I know you know a lot of people and some of them might be generous of spirit and/or gamblers. I think this time of year people yearn to be of help and service but aren’t often sure what they can do. This is one such opportunity.

The fourth thing I’d like you to consider is helping with the benefit dinner. It will be January 11th. There will be a silent auction. I thought with your connections at Microsoft you might be able to get them to donate something for the silent auction like some software or ?. Mr. Gates has such a wonderful legacy of philanthropy and I’m hoping that may reach down the organization for individuals in need.

Thank you Chris for your consideration. If all you can offer is your prayers I will understand and greatly appreciate them. If you or anyone you pass this on to wish to purchase tickets, checks can be made out to TOM NEEDHAM LIVER TRANSPLANT FUND. Anyone wishing more details can contact me, Mark Needham at 952-226-1769 or e-mail me at emkayen@aol.com. I will be happy to fill out the tickets and return the stubs to them. The information needed is name, address & phone number for both the Big Money and Quilt raffles. The Minnesota lawful gambling exempt permit # is X-34753-04-001.

While I don’t know my uncle’s brother (his part of the family never really mixed with mine for some reason), because it’s important to my uncle, I’ll be purchasing one of each of the two kinds of raffle tickets, publicizing my uncle’s plea on my web site, investigating Microsoft’s matching for charity and, of course, sending my prayers. If any of you is interested in participating in the raffles, let Mark know directly. If you wanted to publicize this on your own web sites or donate something for the silent auction, let Mark know about that, too. Of course, all prayers are warming accepted.

Thank you very much and have a Merry Christmas and a Happy New Year.

November 30, 2003 spout

Learning to Learn, Part II

Tony R. Kuphaldt, an instructor at Bellingham Technical College in Washington recently emailed me that my Learning to Learn piece spoke to him and pointed me to his web site where he provides a wonderful look at his own experiences in self-teaching. In this paper, Tony describes his insights, starting with an amazing look into my own previous field of employ:

Industry training, at least in its popular form, is roughly based on the model of a fire hydrant: sit in front of it, open the valve, and take a big drink. Due to time limitations, trainers present information at a rapid pace, with participants retaining only a fraction of what they see and hear. What knowledge they do gain seldom passes on to co-workers after the training session, and is forgotten almost as rapidly as it is presented, necessitating continual re-training. … [Students] often leave with the impression of the instructor being something of a genius for being able to present so much information so quickly, and instilling within their own minds a sense of inferiority for not grasping all of it at the delivered pace.”
Further, Tony describes the technique I use to really learn something:
What did I do to learn? Simple: I would challenge my existing knowledge of a subject by trying to apply it to real-world conditions and/or thought experiments. If I didn’t know enough about a topic to successfully apply it to a realistic problem, I would research and study until I did. If ever I was completely baffled by a problem, I could determine my own conceptual weaknesses by incrementally simplifying the problem until I could solve it. Whatever complexity I eliminated from the problem that enabled me to solve it was where my understanding was weak. Once I knew what I didn’t know, I not only knew where to focus my study efforts, but I also felt more motivated to study because I could perceive my own needs.”
Tony characterizes his (and my) self-teaching technique as an internal feedback loop, where the student knows what he doesn't know. This is as opposed to an external feedback loop in an instructional setting, where the instructor knows what the student doesn't know, but the feedback loop is broken between the student and the instructor.

And as if that weren’t enough, Tony takes his goals on the road, as it were, testing a self-teaching-based curriculum on his students and reporting on his results. I find his work especially interesting not because I feel the need to teach the world to teach themselves; I’m perfectly happy to encourage folks to learn to learn, but to have them choose other techniques. However, I do feel very strongly that the Sells brothers learn to learn. I can’t imagine sending them out into the world without a firm grasp of the ability to teach themselves. I don’t know how to do that, though, unless I start home schooling them. That wouldn’t be out of the question except for this unhealthy addiction I have to a steady income stream…

November 29, 2003 spout

The Wonder that is XAML’s Extended Attribute Syntax

The Wonder that is XAML’s Extended Attribute Syntax

Saturday, November 29, 2003

I’ve been playing with GridPanel today and really like how elegant it is. If I say the following:

<GridPanel>
  <SimpleText>Testing</SimpleText>
  <SimpleText>1</SimpleText>
  <SimpleText>2</SimpleText>
  <SimpleText>3</SimpleText>
</GridPanel>

I get the equivalent of an HTML table with four rows with each SimpleText element forming a cell like so (augmented with Border elements not shown above to accentuate the cells):

If I want to split the data into columns, I can do that using the Columns attribute:

<GridPanel Columns="2">
  <SimpleText>Testing</SimpleText>
  <SimpleText>1</SimpleText>
  <SimpleText>2</SimpleText>
  <SimpleText>3</SimpleText>
</GridPanel>

Which gives me two rows of two columns each:

That’s all nice and simple, but still flexible. For example, if I want to set the Testing string to cover two columns, I can give it an ID in the XAML and call the GridPanel.SetColumnSpan static method in code, e.g. when the Window loads:

<!-- xaml -->
<Window ... Loaded="window1_Loaded">
  <GridPanel Columns="2">
    <SimpleText ID="testingSimpleText">Testing</SimpleText>
    <SimpleText>1</SimpleText>
    <SimpleText>2</SimpleText>
    <SimpleText>3</SimpleText>
  </GridPanel>
</Window>
// C#
void window1_Loaded(...) {
  GridPanel.SetColumnSpan(testingSimpleText, 2);
}

This code yields 3 rows arranged as follows:

This is all fine and makes you appreciate the elegance of the GridPanel. However, that’s not what inspired me to write this entry.

Remember that the SimpleText element serves as a cell in the GridPanel. Even better, the SimpleText element doesn’t know it’s serving as a cell in a GridPanel. The architecture of Avalon is loosely-couple so that all of the elements don’t need to have intimate knowledge of each other. This loose coupling is really great for future elements that some developer wants to host in a GridPanel or that want to host SimpleText elements. Still, I’d like to be able to set GridPanel-related properties for each cell” on the cell element itself, even if the cell element doesn’t know it’s a child of a GridPanel. And that’s what the extended attribute syntax in XAML lets me do. Instead of writing the code, I can just do this:

<GridPanel Columns="2">
  <SimpleText GridPanel.ColumnSpan="2">Testing</SimpleText>
  <SimpleText>1</SimpleText>
  <SimpleText>2</SimpleText>
  <SimpleText>3</SimpleText>
</GridPanel>

This dotted attribute syntax allows me to set a GridPanel setting for the SimpleText element w/o any knowledge from the GridPanel of the SimpleText or vice versa. That means that if I define the FooBar element tomorrow, I can set it’s GridPanel.ColumnSpan on it when it’s used inside a GridPanel w/o extending GridPanel. This also means that if FooBar has a Quux per-child property, I can set the FooBar.Quux attribute of the SimpleText element w/o extending SimpleText. Nice!

BTW, if you’d like to see the code that provides the GridPanel in outline mode” as above, it looks like this:

<Border Background="black" Width="100%" Height="100%">
  <GridPanel Columns="2">
    <Border Background="white" GridPanel.ColumnSpan="2">
      <SimpleText >Testing</SimpleText>
    </Border>
    <Border Background="white">
      <SimpleText>1</SimpleText>
    </Border>
    <Border Background="white">
      <SimpleText>2</SimpleText>
    </Border>
    <Border Background="white">
      <SimpleText>3</SimpleText>
    </Border>
  </GridPanel>
</Border>

Notice that the GridPanel.ColumnSpan is on the Border element, not the SimpleText element. That’s because it’s the Border that’s the cell of the GridPanel, not the SimpleText.