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.
Thursday, Oct 7, 2004, 11:56 AM in The Spout
You Too Can Be A Technical Writer!
Here.
The one where I outline every technical piece I've ever written.
Thursday, Oct 7, 2004, 11:14 AM in .NET
Settings, Collections and VS05b1 (oh my)
Here.
The one where I get to try out the interaction between VS05, Windows Forms 2.0, application and user settings (wahoo!), generics and versioning, discovering that, while this combo still in beta, it's still pretty darn wonderful.
Thursday, Oct 7, 2004, 12:00 AM in The Spout
Settings, Collections and VS05b1 (oh my)
I sat down to write a new Windows Forms application in .NET 1.1 the other day, but the Visual Studio 2005 beta 1 called to me with its "menu strips" and its "user settings" and most especially its "generics," and I just couldn't resist.
To start with, it was such a pleasure to add a menu strip, add in the standard menu items (including graphics), then just strip it down to just the menu items I wanted. Then, as I added new menu items, the menu item object names were set for me based on the menu item text, e.g. startRetrievalToolStripMenuItem instead of menuItem1, which was fabulous. Not everything was wonderful, e.g. I couldn't drag and drop menu items or use Alt+arrows to rearrange them , but overall the new menu control was a pleasant experience.
Even more pleasant was the app/user settings model. To add a setting to my application, all I had to do was bring up the properties of my project, add a named setting of whatever type I wanted (more on this later) and choose whether it should be an Application setting or a User setting. Both kinds of settings are loaded automatically when the app starts and all I had to do to save them was call Properties.Settings.Value.Save() when my main form shut down. Then, with the settings in place, e.g. MyUserSetting, I could get to it after the app started from anyone in my app with a type-safe access, e.g. Properties.Settings.Value.MyUserSetting.
And this didn't just work for built-in simple strings and ints and such like. Oh, no. I was allowed to add custom and collection types like System.Collections.Generic.List<MyNamespace.MyType> as well. Plus, using generics, the underlying XML serialization mechanism worked great, because all of the types are known at compile-time (settings are stored in standard XML .config files @ c:\documents and settings\<user name>\Local Settings\Application Data\<company name>\<product name_hash>\<product version>\user.config). Being able to declaratively set app and user settings of any type and then just use them in a type-safe manner, saving them with one line of code, loading them with zero lines of code and not having to flatten my collections into comma-separated lists made things so pleasant until I hit the ugly realities of beta software, especially as new features interact with existing features and each other.
For example, because the default AssemblyVersion attribute is set to "1.0.*" in AssemblyInfo.cs (which has moved to below the Properties folder of your VS05 project), every time I compiled, all of my settings were lost. That seems very counterintuitive to me. Why should a user lose all of their settings with the new version of the application? To work around this, I changed my AssemblyVersion attribute to a hard-coded string that I now have to remember to change manually, blowing the benefit of having a version number that changes automatically with each build.
As another example, like C++ "const" of old, generics infect your code; use them in one place and you find yourself using them all over. That was fine with me (the generic Predicate<T> for finding things in a List<T> was so handy!) except that as of b1, the Windows Forms Designer gets all unhappy when you use generics. I have every hope that this will be fixed by b2, but as of right now, if I wanted to use the Designer (and it's so sweet, how could I not want to use it?!?), I had to strip out any methods or properties in my visual code that exposed generics (although method and property implementations with generics works just fine).
Stripping out List<T> brought me to the use of ArrayList instead. That worked just fine (System.Collections.ArrayList is even available via the Browse button when setting up app/user settings) until the XML serializer couldn't serialize instances of the custom type that I was using to populate my ArrayList. The error looked like this:
Could not use Xml serialization for setting: SelectedExchanges. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type MyNamespace.MyType was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
When I start up the debugger to see the line of code where the error is happening, I ended up in Main because the code is part of the Application start-up for which there is no source code, making this even more difficult to debug. The problem was that the underlying serialization engine didn't know what to do with this custom type. The clue was the mention of the XmlInclude attribute, which you can use to tell the serializer what types may be in the ArrayList, but you have to have somewhere to hang the attributes. In this case, that lead to a custom ArrayList type for the express purpose of informing the serializer (making me really miss the use of generics, where all of the types were specified at compile-type for me automatically):
[System.Xml.Serialization.XmlInclude(typeof(MyNamespace.MyType))] public class MyList : System.Collections.ArrayList { public override object Clone() { MyList newList = new MyList(); newList.AddRange(this); return newList; } }
Notice also the Clone method. I added this later because the base ArrayList Clone method creates an instance of ArrayList, not my custom MyList type. Of course, since this was all run-time type errors, I couldn't let the compiler tell me about these problems; I had to run my app and find them. Very frustrating, especially when generics makes these problems all go away.
Still, I'm very much enjoying the new productivity features in VS05 and Windows Forms 2.0 and when they work better together, I'll be even more happy.
Thursday, Oct 7, 2004, 12:00 AM in The Spout
Every Story I've Ever Written
I was working with a potential author on an article he'd like to write covering some ground I left uncovered in my original No-Touch Deployment piece for MSDN Mag. Anyway, he sent me the list of topics and then said the following:
"There is a fair amount of material here it might benefit from being broken into chunks. I think I will write about small chunks at a time and then we see how much belongs in one article. Rereading your original article it struck me that you had [a] story that held it together, I need to find one for me."
I've heard this kind of thing before, i.e. people ask how I turn a seemingly random set of topics into "a story." I'm all for that, but it's not really such a chore. In fact, here's the essence of every technical piece I've ever written:
"So, I want to build this thing that needs to do this, that and the other. I started with this, did it this way and it worked. Now I need to do that. Oops. That didn't work the way I thought it should. Here's what I need to do to work around the problem. OK, now I want to do the other... [repeat]"
The secret is really building up from what the reader already knows with some minimal new, interesting thing and keep on like that 'til you've covered the ground you want to cover, stringing things together with transitions that give the reader the impression of one contiguous story. If you really want to get fancy, put a personal anecdote at the front that you use as an analogy, bring it up a few times during the piece and then wrap up with something clever that ties the your anecdote together with the ground you've covered by extending the analogy in a humorous way (but that's optional).
Wednesday, Oct 6, 2004, 9:05 AM in .NET
Ryan, My Favorite Feedbacker
If I'm doing the calculations correctly, Ryan Dawson is not yet old enough to drink, but he still manages to give the best, most direct, most thorough feedback of anyone in the WinFX/Longhorn developer community (Ian Griffiths is a close second, but he's got that English polite thing going for him, so it's hard to know just how much he's really complaining : ). Ryan's built apps to test the various pillars and makes his complaints very clear, as in this post about Avalon 3D.
That's not to say that I agree with everything he says or that the product team agrees, but I wish I had 100 more Ryan Dawson's banging on the pillars and complaining loudly and clearly so that the product teams can get some crystal clear feedback on what works, what doesn't and what developers want. If you don't have a blog, get one or post your complaints on the newsgroups. Come on! Tell us why we suck and what to do to stop sucking! You know you want to. : )
Tuesday, Oct 5, 2004, 9:31 PM in Conference
From Chris Sells to Sam Ruby
I can't get Sam to reply to my emails, so I'm hoping he'll see this post: Sam, can I get the status of your DevCon slides? They were due Monday. Thank you.
Monday, Oct 4, 2004, 3:56 PM in .NET
Thinking About Developers and Smart Clients
I've recently added another castle to my empire by taking on the Content Strategist duties for the MSDN Smart Client Developer Center.
When I step into a new project, my typical mode of operations is to gather goals and issues from as many people as care that I can find, stir it all up with what I think is important, run it up the flag pole, repair the bullet holes a few times and then execute. I'm in the "gather" mode on the SCDC right now and I'm curious what your goals and issues are for the SCDC as it stands today and for what you'd hope it to become tomorrow. Feel free to respond to this post (even anonymously if it makes you feel more comfortable) or email me. The idea is that the SCDC becomes a valuable place for Microsoft developers building Smart Clients of all kinds, but particularly using Windows Forms, the Compact Framework, Visual Studio Tools for Office (did you know that they have a ClickOnce equivalent?) and WinFX.
BTW, I'm still the Content Strategist for the Longhorn DevCenter, so don't go getting your hopes up that I'll stop beating that particular drum. : )
Monday, Oct 4, 2004, 3:12 PM in Conference
XML Developer's Conference Hotel Rooms Releasing
Here. If you haven't made your hotel reservation for the Applied XML Developer's Conference, Oct. 20-21 at the Skamania Lodge in Stevenson, Washington (40 minutes from Portland Int'l airport), you'll want to do that today as the rooms we've been holding are about to be released to the general public. Also, if you haven't registered for the conference, you'll want to register now, as we've only got a few seats left.
Monday, Oct 4, 2004, 9:10 AM in Fun
Brian Kernighan on Debugging
I saw this in an email from John Mason in PSS today:
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
--Brian Kernighan
Sunday, Oct 3, 2004, 6:24 PM
Charlie Kindel on Home Servers and Storage
Charlie Kindel has been an idol of mine since the COM days. As an MS employee, he set the standard of openness towards externals long before it was in vogue. Recently, he's been posting on a topic near and dear to my heart: in home servers and storage.
Right now, I've got two: a file server and a media server (or, what I hope to become a media server when Media Center Extender boxes are available). Alone these lines, two recent posts are of particular interest:
While my backup system works, it's not nearly as robust as I would like it to be and due to size constraints, I don't even back up my audio or video media (although I do back up the images), so I'm very much looking forward to Charlie's further writings on this topic.
P.S. While I don't believe that this attitude has anything to do with Charlie Kindel, if there had been a 3rd Sells Brother, he would've been named Charlie. Likewise, I've always hated my girlie name and sometimes think about changing it. To what, you ask? You guessed it: Charlie. : )
Saturday, Oct 2, 2004, 10:01 PM in Tools
Mixed Feelings
For the last few months, I've been doing some really cool work with a group of folks whose only task is to build apps that exercise the WinFX technologies so that we can make sure stuff works the way we want it to and give feedback to the product teams when it doesn't. Because we're still in preview technology land, various features that we want to test are in various builds of each part of WinFX, so we're constantly fooling around with new combinations of the bits, which we bring together in VPC HD images and that I then have to download. Since I'm downloading the 7+ GB images from my house over VNC and since the internal VNC connection software isn't quite as robust as the VNC software we ship to the rest of the world, that means that I'm constantly being kicked off of my connection and reconnecting, sometimes 2 or 3 dozen times over the 2 days it takes me to download the image. I just finished downloading another build today.
Unfortunately, when setting the Administrator password, I managed to enter the wrong thing twice, which meant that I had no way to log into my new VPC image after 2 days of hard labor getting it to my house. So, instead of re-downloading it again, I googled for a utility to reset the Administrator password. The first link was a knowledge base article from MS that didn't help me because I hadn't yet logged in to make myself a password reset diskette (which, frankly, I never do anyway). The second link was a list of completely unsupported, possibly illegal, tools to reset the Administrator password. The first one on that list worked like a charm in several orders of magnitude less time than downloading a new VPC image.
So, now I have mixed feelings. On the one hand, I'm happy that I didn't have to go through all that trouble again, but on the other, I doesn't seem very useful to set my Administrator password to anything useful if I anyone with physical access can just reset it so easily. Of course, Keith Brown and other security experts have been saying that physical security is paramount for any other kind of security to be affective, but it was kind of unsettling to have the point driven home so starkly.
Saturday, Oct 2, 2004, 7:53 AM in .NET
Learn Indigo in 5 Minutes
Well, to be fair, Don leaves some details out, but he wanted to see if he could explain Indigo in 5 minutes or less. Worth the read.
Friday, Oct 1, 2004, 4:00 PM in .NET
Avalon: Modern Day Compositing & Rendering Engine
Brian Pepin, Development Lead on the Windows Forms team, has some interesting observations about Avalon and what it means to developers. I particularly like his take on Avalon vs. Windows Forms for control developers and users:
"[Avalon is] needed by control developers everywhere so they can create controls with great usability without hiring an army of Win32 experts. It’s needed by end users because they deserve to have great usability in all their applications, not just the ones that Microsoft threw a bazillion dollars at."
I also like what he has to say about Avalon vs. Windows Forms for application developers:
"It’s also important to realize that from an application developer’s perspective, there is little difference between Avalon and Windows Forms. For years there will be interesting controls built from both technologies."
In other words, Avalon is the necessary next step to build more powerful controls so that users get the most out of their applications without requiring a giant change in development methodology for application developers.
Thursday, Sep 30, 2004, 3:54 PM in Fun
The GLAT: I couldn't resist
I'm not going to move, but I couldn't help printing out the test...
Wednesday, Sep 29, 2004, 10:20 AM in The Spout
BankOne: Special Victims Unit
I have a BankOne Visa card that I use for Sells Brothers, Inc. as a charge card for expenses like computer equipment, technical book purchases and strip clubs (you know -- business expenses : ). Apparently somebody got a hold of the number and started making charges with it today. A $19 charge was approved, but the $331 charge swung the BankOne AI software into action and the charge was declined. They called right away to confirm the activity and when I didn't recognize it, they credited me the $19, canceled the card, put a new one in the mail, sent all three major credit card agencies a notice so that my credit rating wouldn't be affected and put an affidavit in the mail so that I could swear that the $19 charge wasn't mine. All of this defense against identity theft cost me 5 minutes on the phone, a few days wait while I receive my new card, a signature and $0. Amazing.