# Thursday, 03 September 2009
Scott Hanselman has done quite a few posts on Windows 7 topics already. But now he's done a lollapalooza! He covers:
  • The Code7 contest - How to get a trip to PDC and $17,777. Not bad eh? Also covered by Yochay.
  • XP2Win7 (aka PhotoView) - I've covered it before and I won't repeat the links from that post. Scott includes a gratuitous underwear shot you're going to love.
  • Code Pack - you know it almost deserves its own category here on my blog. Like Scott says, a gold mine of samples in both C# and VB.
  • 16 bonus links and the "lightweight" parameter for MSDN.



Speaking of the PDC, they've released a bunch more sessions... it's looking very good. I have to pull the trigger soon on a decision about going straight to the PDC from Tech Ed Europe. It's calling me...

What are you waiting for? You need to read Scott's post.

Kate
Thursday, 03 September 2009 10:01:35 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 01 September 2009
Here's a recording of a panel at Tech Ed this summer featuring four dear friends of mine: Stephen Forte, Joel Semeniuk, Chris Menegay, and Richard Campbell. The title is "Agile: A Process or an Excuse?" but they don't really answer that question. Instead they talk about what Agile means to them, what to say if people argue about whether you're agile or not, and the role of tooling including Visual Studio Team Systems, sticky notes, really large sticky notes, and Excel spreadsheets. They don't agree on all of it, which makes it a good panel, but the insight is useful. Most interesting to me: Joel and Chris have been in the "I am the guy you are making the software for" role on some internal projects - and found themselves doing everything that your usual contact over in the business unit does when you ask for requirements - forgetting some, being vague, leaving out special cases, and demanding changes because of changes in the business model out in the real world. Users don't do these things because they don't know any better; they do them because that's how life is. An agile approach lets you live in that reality instead of bemoaning the fact that no-one will stick to the things they signed two years ago. I listened on fast speed, but I suggest you only do that if you've spent a lot of time listening to these four because they're pretty fast talkers to begin with, and faster still when they get excited about a topic.

Kate

Tuesday, 01 September 2009 09:37:34 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 30 August 2009
As you probably know, we're on our way to a new version of the .NET Framework. There's so much that is new in it you could hardly know where to start. I'm just letting the information wash over me in other people's blogs, and trying things out with the beta from time to time. I spotted two related things in the last little while.

First was Improvements to Interop Marshaling in V4: IL Stubs Everywhere on the CLR team blog. The takeaways here are faster performance, consistency between the 32 and 64 bit worlds, and better debugging. Since there is still a lot of native code hiding underneath your managed calls to library functions, everyone cares about the faster performance aspect. Read the post for all the details if interop matters to you the way it matters to me.

Second was COM Interop Gets Much Better in C# 4.0 on DevX. I've always avoided C# for COM interop work because it doesn't do optional parameters, and most COM work is rich in them, especially working with Office, which I used to do quite a lot of. Less casting, no need for PIAs, no more fake values called "missing" or some variant thereof ... it's all good. And here again the magic words "improved performance".

Two small things to note with a non-small impact on your life as a developer.

Kate

Sunday, 30 August 2009 15:03:23 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 28 August 2009
Alan Skorkin reminds us that much of what drives current software development process came from the more general study of process for all kinds of work, including manufacturing. When you decide to adopt a particular process, you do so to reach a goal and for that vast majority of businesses, that goal is productivity - more profit per time period. (For a few very small operations, less time period to earn the profit / income sounds far more humane, but is still based on a desire for higher productivity.) Whenever you adopt a process instead of just telling your staff to do whatever you want, it's because you don't think they would be as productive left to their own devices as they would be under the direction of the process.

As Alan points out, there are two very different thoughts behind this basic position. One says that workers are lazy and shiftless. They'd rather chitchat, smoke, or daydream than produce what management wants them to produce. Processes built on this thought are all about measuring and controlling and proving that people have or haven't done what they should have done. The second, christened Theory Y in contrast to the first, which got dubbed Theory X in order to tell the two apart, says that workers are much happier when they know they are productive, and need management to help them achieve productivity as a co-operative goal. Processes built on this thought are full of collaborative work and empowering and the like.

He goes on to draw some specific conclusions about Lean that I will leave aside. I think it's useful to look at the process you work with day to day and ask yourself - is this process founded on Theory X or Theory Y? What image does the management at your firm have of the workers at your firm? Does process control them or support them? Is the motivation for workers assumed to come from inside themselves, or to be imposed by management? No matter what management says about what developers can and can't do, the process you work with will tell you their founding principle. It might be an eye opener to think about it like that.

Kate

Friday, 28 August 2009 13:35:41 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 26 August 2009
It wasn't long ago everyone was talking about a whole new way of working. It started with telecommuting in the 90's, but spread in this century to something far bigger. Remote work as a way of life, virtual teams, outsourcing, offshoring ... the scale just kept growing and the savings for companies appeared to be at least partly met by happy staff, whether that was a guy in the city who didn't have to spend 90 minutes each way in traffic, or a guy who was able to keep living in his small town while working for the big city firm so far away, or even a guy in a developing country who was able to earn more than his neighbours and follow the lure of high tech and problem solving at a time when no firms in that country were offering those jobs. I know many people in the big cities and the developed countries lost their jobs to those people, and I know it wasn't always simple to find traditional employment once the world of work started to change. Still, the world and the way many people in it earn a living changed and will not be changing back.

That said, in the mid 90s everyone I knew who was associated with any of this "new way of working" had come to realize it wasn't just a fire and forget sort of thing. You had to communicate a lot. And while technology made some ways of communication simple and cheap, so that video calls and conference calls and instant messenger and desktop sharing and so on are all vital, it couldn't do it all. You have to get face to face still, and you have to do it regularly. I recently finished a 10 month contract for clients three thousand miles away. I did the vast majority of the work from here, and had phone calls and livemeetings many times a week. But every 4 to 6 weeks I got on a plane and I went there. And wow, the work we got done in those few days! Mini hallway meetings, lunches, dinners -- I typically could "touch" half the project participants in just two or three days, and solve seemingly intractable problems by going to people's offices and listening to them and looking at their body language and telling them they could trust me or asking them what the real problem was. It made such a huge difference to the success of the project. I didn't get paid for the time I spent travelling to them, or the nights spent away from my family, but I gladly invested that time to make everything go smoothly and to be a successful remote worker.

Some other folks have noticed this too, and in a far more systematic way. How's this for a conclusion: "... common workplace-relationship problems, such as broken commitments, mistrust and misrepresentation of information, occur more than twice as often with virtual teams, as opposed to teams located in the same building. " Yikes! Apparently it's partly because things we do when we're upset with people work well if you see if each other regularly, but make things worse if you're apart. Or this useful summary: "teams are a lot more effective when they're working with their friends in another country than when they're working with those stupid offshore idiots who never understand our designs or requirements." So in that context, what could be a worse way of saving money than lowering the travel budget to zero and not letting people visit each other any more?

Yet that is exactly what's happening in a lot of companies. If it's happening in yours, do something about it. You need to visit your colleagues. If not, when your projects go pear-shaped, you may find the whole concept of virtual teams gets thrown out with it. And that would be a real shame.

Kate

Wednesday, 26 August 2009 13:53:50 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 24 August 2009

I am pleased to learn that at least one of the sessions I submitted for Tech Ed Europe in Berlin has been accepted:

The Windows API Code Pack: How Managed Code Developers Can Easily Access Exciting New Vista and Windows 7 Features

Accessing new Windows 7 or Vista features is a challenge from managed (.NET) code. The level of interoperability required is out of reach for many developers. The Windows API Code Pack for the Microsoft .NET Framework is a sample library you can use in your own projects today that provides access to new user interface features (taskbar jumplists, libraries, sensor platform and more) as well as "behind the scenes" features that make your applications more aware and responsive (restart and recovery, power management, and more.) Discover a shortcut to Windows 7 and Vista development for Microsoft Visual Basic and Visual C# programmers and how you can get involved.

Now comes the logistics fluffle of getting everything booked, telling "my" teams I'm going, and possibly picking up some other talks or panels or whatnot while I'm there. I'm looking forward to it already! I love Tech Ed Europe - it's such a well run show and the other speakers are a delight to spend time with and learn from. The energy is always good and on top of that the destination is fabulous. I adored Barcelona, so now it is time for Berlin to show me what she's got. What a week we've picked to be there!

 

You can still register at a discount. See you there!

Kate

Monday, 24 August 2009 12:01:56 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 22 August 2009
I've done several Tech Ed talks, in Europe and the US, in which I've demoed lambda expressions, a new language feature coming in C++0x and implemented in Visual Studio 2010. If you missed your chance last year to watch my Tech Ed Europe talk, it's still available on page 3 of the "last year's highlight's" page. But that's 80 minutes and covers more than just lambdas. If you would be up for investing a tenth of that time, try this Channel 9 piece featuring Thomas Petchel. He's obviously VERY familiar with the STL and he illustrates perfectly how writing dinky little functions to initialize arrays can be tedious and time consuming, and how lambdas make them faster. If you watch that and like what you see, go ahead and give my Tech Ed talk a listen as well.

Kate

Saturday, 22 August 2009 09:23:29 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 20 August 2009

Recently I came across an article suggesting how a good developer should comment their code. This was aimed at those writing SQL scripts, but that doesn't particularly matter. The rules were the same ones I lived by in the 70's and for a long time since then. For example, at the start of each file there should be a modification history, like this:

/* Title: 002 - Setup SQLCMS.sql
Purpose: Setup the various components for SQL CMS
Version: 1.1
Modification History:
04/30/2009 - Buck Woody - Initial Script Creation
05/15/2009 - Buck Woody - Added MAPS load scripts

I copied Buck's since I don't have any like this myself kicking around. And why not? Because VSTS and TFS take care of that for me. Who changed it, what they changed, and why is all available in the repository. Duplicating it in the file itself just gives you another task to forget, and another pair of locations that might get out of sync. So I don't do these any more.

There's another kind of comment that we all used in the 70's and 80's and that was the "explain your names" comment. When you only had 8 characters to work with, you needed a big block of comments that told everyone that NPPLINV was Number of People Invited and CIDMNEW was Calculate Interest, Daily Method, New or whatever. But we don't have name length restrictions any more. So why do I still see this sort of thing:

Dim ClientName as String      ' Variable to hold name of client
Dim ClientBirthDate as Date ' Variable to hold birth date of client
Dim ClientRepID as Integer ' Variable to hold ID of client rep

(Don't believe me? I saw this very code yesterday in a VB6 app I was debugging.)

As Jon Torresdal points out, if you choose your function names and variables well, you don't even need those single lines that explain funky-looking calculations. Extract your weird stuff to a function, even if it's a single-line function, and it explains itself. You can see a similar approach, though comments are never mentioned, in Justin Etheredge's post about isolating logic into little functions.

So let's see, no comments at the top to explain what the file is, no comments after each variable to explain its strange and abbreviated name, no comments before funky calculations because they've been refactored into single line functions ... well what comments even remain, then? Well there's commented-out code - but I have a rule against that. There's this sort of thing:

'only update confirmed date the first time it's confirmed
If DateConfirmed = Nothing OrElse DateConfirmed = New Date() Then
DateConfirmed = Today
End If

Sometimes these comments are there because the developer wrote the comments first, as pseudo-code, then filled in the code. Other times they are just an attempt to translate the code into English for the reader. Does it help? Well, maybe. But comments are becoming less and less important as time goes by. Interesting.

Kate

Thursday, 20 August 2009 09:57:01 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 18 August 2009
I've read a few articles lately that have no praise for the praise sandwich. If you haven't heard that name before, it refers to something like this:
Joe, I really like the confidence and energy you bring to your work. But yesterday's outburst was unprofessional and frankly unacceptable. It's the sort of thing that could get you fired. But you're such a smart guy that I'm confident you'll never do anything like that again. You're an important part of the team and we're all glad you work here.
You start out by saying something nice, then criticize, then say something nice again to end the meeting on a positive note. So what's wrong with that? Well partly it's all the "but" in there. I've talked about that before. There's more to it, though. Esther Derby says it "tends to erode trust in the feedback givers intentions, and once that's gone, there's not much chance any useful information will get through" which is a very good point. Her advice about how to deliver criticism is very good, most especially "don't sell past the close." Art Petty says it is "insulting to the receiver and borderline deceitful" and is really about making the criticizer feel better, not the recipient. Of his tips, I especially like "link the issue to business impact" - one of the real strengths the boss brings to any situation is the extra information about the consequences of errors. I have found over the years that people who write code all day really don't see a problem with broken links or bad images on live websites, because it still works and it's not like there was a code problem. That's just one example of course, but if you want to change someone's behaviour, it's important that they actually understand why it's truly a problem.

I couldn't count the number of times I've had to tell someone they really screwed up. I know there were times it was as little as two words. After establishing the facts of the matter, I once just sighed and said "Not cool." That was all that employee needed to be told. I've also had very long and heated conversations that did not result in changed behaviour. These days I go for shorter over longer. And I don't do sandwiches.

Kate

Tuesday, 18 August 2009 09:23:47 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 16 August 2009
I've mentioned the sensor improvements in Windows 7 a little bit, but they really deserve a good long blog post of their own. Luckily for me, my fellow RD Sondre Bjellås has written it :-).


This is a handy demo board that does light as well as position (think Wii) with some buttons you can push. Sondre covers where to get the board, where to get the drivers, and a really simple sample app to get you started. Then you're going to want the Windows 7 Training Kit - the Hands On Labs have some fun demos. Check it out!

Kate
Sunday, 16 August 2009 19:04:13 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 14 August 2009
What language do you think this post by Jeff Atwood refers to?
There are over 220 billion lines of <language> in existence, a figure which equates to around 80% of the world's actively used code. There are estimated to be over a million <language> programmers in the world today. Most impressive perhaps, is that 200 times as many <language> transactions take place each day than Google searches - a figure which puts the influence of Web 2.0 into stark perspective.
Wow. 220 billion-with-a-b? B as in Business? As in Business-Oriented-Language? You know, the only thing I like about COBOL (and I have written precisely one COBOL program in the three decades I've been paid to program) is that it made it possible to have a language called SNOBOL.

The comments are full of folks who are maintaining 30 year old apps with a million lines of code, but the thing about billion-with-a-b is that you need 220,000 such folks to hit that number, and what's more as Larry O'Brien points out 20 years ago folks said there were 30 billion lines, and while I can agree that existing apps are being maintained, I don't think there are 7 times as many lines of COBOL out there now as there were at its peak.

But that's not my point. My points is that when you live at the leading edge, the bleeding edge, you forget a really important rule: edges are thin. The handful of us who are moving our apps to 4.0 now, who are complaining about an incompatibility between our Visual Studio 2010 beta and our Office 2010 beta, who are using a language invented this century, are dwarfed by folks who have been using the same tools and the same languages throughout their entire career. These people are invisible because they don't come to conferences, attend user group meetings, buy programming books, or read blogs. Heck, at one of my clients, the AS/400 guys sat off to the side and behind a little wall of cubicle partitions that was double the height of everyone else's. Really. They also never came to all-hands meetings and were exempt from the company-wide .NET training I delivered.

So do these "dark matter" developers matter to the "bleeding edge" developers? I think they do. For one thing, when you have your shiny and exciting idea to change everything about the way some software works, these guys can cancel your whole project with one or two sentences. For another, they are likely the only ones who understand the data format, the business rules as actually coded, and the special cases that come up every 15 to 20 years. Not to mention they can work the text editor. If you find yourself in a situation with some COBOL (or equivalent) developers in it, don't ever tell them you didn't think they existed any more. That's my tip to you.

Kate

Friday, 14 August 2009 18:39:40 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 12 August 2009
There was a bit of a kerfuffle in the C++ standards world in mid July arising from the summer meeting of the ISO C++ committee. Agreement couldn't be reached on how to implement concepts. In the end it was decided not to include them in the next version of the standard.

What are concepts? They improve the experience for template consumers. C++ templates are amazingly powerful, but using them can involve a lot of guesswork and a lot of swearing. They're pretty easy to write, and just by typing a line of code you create a requirement, a pre-requisite, for anyone who wants to use your template. If you write a template that takes two instances of class T called t1 and t2, and then somewhere it says t1 + t2 or t1 < t2, then your template can only be used with types T that have the operator + or the operator <. Anyone who uses it for some other type is going to get an error message that might be useful, but might be your typical nasty template-related error message. That makes templates easy to write, but hard to consume. Short of actually reading through the code for the template, you can't know before you try compiling whether or not your consuming code actually meets the requirements for using the template.

Generics in .NET deal with this through constraints - the generic writer identifies the interfaces that must be implemented by any type that will use the generic - IComparable or IEnumerable etc. If you want to use the generic, you  implement the interface, and the compiler will help you get that done with readable error messages.

So that was the heart of concepts. Some sort of decoration you would put on your template to say "here is what I expect of those that use me." How important are they in general, and how important to C++0x?
  • concepts’ presence or absence in C++0x just won’t make much difference to most users - Herb Sutter
  • [concepts were yanked out and that is] a major setback for C++, but not a disaster - Bjarne Stroustrup
  • removing them was our best available option both for C++0x and for concepts as a language feature - Doug Gregor
  • Not the end of the world, but disappointing nevertheless - Alex Fabijanic
What do I think? I think that template consumers fall into two large categories - those who consume templates they wrote themselves, and those who consume the STL. If you wrote it, I hope you know what it needs, and if it's the STL, well you can paste your opaque error message into a search engine and someone's blog will tell you what you need to add to your class to use that template. I don't think there are a lot of people consuming poorly documented and sparsely used templates. I agree that concepts could result in that sector growing some day, but that few developers are walking around wishing for them or feeling the pain of not having them. I'm sure it's a disappointment to everyone who put so much work in to them, and who will continue to work on them towards inclusion in a future version of the standard, but the rest of us can relax and get ready to see the other C++0x goodies included in a standard where x might actually fit in a hex digit.

Kate

Wednesday, 12 August 2009 14:59:55 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 10 August 2009



Of course the most important sessions at PDC couldn't possibly be announced yet. The best are the ones that are TBD in the session list and schedule right up until the keynote. That's how you know something big is going to be announced. Imagine something where just hearing its code name, just knowing who was going to give the sessions, or even a single sentence of description would spoil the whole announcement. Those are the sessions you go to PDC for, so it's a bit like a Christmas present ... you can't know in advance what it will be.

But it's a four day conference with a lot of sessions and some of them can be announced in advance. I can see that this year some folks have decided to have slightly more interesting session titles (along with the more traditional titles):
  • Zero to Awesome in Nothing Flat: The Microsoft Web Platform and You
  • Windows Workflow Foundation 4 from the Inside Out
  • Windows Identity Foundation Overview
  • Windows 7 and Windows Server 2008 R2 Kernel Changes
  • Using Classification for Data Security and Data Management
  • Under the Hood with Microsoft SharePoint 2010 Programmability
  • The State of Parallel Programming
  • The DirectX 11 Compute Shader
  • Simplifying Application Packaging and Deployment with Microsoft SQL Server 2008 R2
  • Petabytes for Peanuts! Making Sense Out of “Ambient” Data.
  • Microsoft Visual C++ 2010: The "Accelerated" Way of Building Applications
  • Microsoft Unified Communications: Developer Platform Futures
  • Microsoft Silverlight Roadmap and Futures
  • Microsoft Silverlight 3 Advanced Performance and Profiling Techniques
  • Manycore and the Microsoft .NET Framework 4: A Match Made in Microsoft Visual Studio 2010
  • Development Best Practices and Patterns for Using Microsoft SQL Azure Databases
  • Developing xRM Solutions Using Windows Azure
  • Developing .NET Managed Applications Using the Office 2010 Developer Platform
  • Developer Patterns to Integrate Microsoft Silverlight 3.0 with Microsoft SharePoint 2010
  • Data Programming and Modeling for the Microsoft .NET Developer
  • Building Applications for the Windows Azure Platform
  • Automating “Done Done” in the Dev-to-Test Workflow with Microsoft Visual Studio Team System 2010
  • Accelerating Applications Using Windows HPC Server 2008

My favourite title in there is definitely "Manycore and the Microsoft .NET Framework 4: A Match Made in Microsoft Visual Studio 2010" but there are other contenders for sure. As for the topics themselves, I think many of us have still not given concurrency/parallelism/manycore the attention it deserves, and all of us are guilty of compartmentalizing what we learn about so I bet you have probably ignored something (Silverlight, or SharePoint, or Azure, or the full power of VSTS). That means these sessions alone will make us better devs. If these titles are enough to get you signed up, do it now while you can get a $500 (US) discount - from $2095 for the whole conference (except workshops) down to $1595 until Sept 15th. Wait till Labour Day to start bugging your boss about it and the discount will be gone, plus the plane tickets will be more expensive. (Oh, if you're a student or teacher, you pay only $595, which gives you an astonishing way to get head and shoulders above those around you.)

There are also some seriously intelligent workshops scheduled:
  • Getting the most out of Silverlight 3
  • Patterns of Parallel Programming
  • Developing Quality Software using Visual Studio Team System 2010
  • Architecting and Developing for Windows Azure
  • Microsoft Technology Roadmap
  • Software in the Energy Economy
  • Developing Microsoft BI Applications - The How and The Why
Four of those seven workshops are being given by RDs, meaning you'll get real world experience along with the technical product knowledge. What a way to get caught up on something you weren't paying attention to!

Going to conferences is getting harder and harder to justify in this climate. But that doesn't mean you stop going to conferences - it means you only go to those that are relevant to your work and offer amazing value (content, people, atmosphere, and otherwise-unavailable bits) in return for your registration fee, travel, and time away from work. The PDC offers just that for devs on the Microsoft stack. It's the only conference I've ever paid my own money to get to. Be there!

Kate
Monday, 10 August 2009 11:49:32 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 08 August 2009

Code Pack, or Windows® API Code Pack for Microsoft® .NET Framework to use the official name, has hit 1.0 with the RTM of Windows 7 and is now available for your downloading and coding delight. Yes, two registered trademarks in the name, but still technically not a product. It's the most useful not-a-product I know. The mission statement, if you will, of Code Pack is:

The Windows® API Code Pack for Microsoft® .NET Framework provides a source code library that can be used to access some new Windows 7 features (and some existing features of older versions of Windows operating system) from managed code. These Windows features are not available to developers today in the .NET Framework.

The parenthetical in that description is referring to Vista features like Restart and Recovery and Network Awareness, among others. If you've been playing along throughout the beta period of Windows 7 you probably have three questions:

What's in 1.0 that wasn't in 0.9?

  • Shell Search API support.
  • Drag and Drop functionality for Shell objects.
  • Support for Direct3D and Direct2D interoperability.
  • Support for Typography and Font enumeration DirectWrite APIs.
Will my 0.9 stuff work with RTM or should I get 1.0?
  • You should get 1.0 because it has some bugfixes in it.
Can I use 1.0 on a machine running the RC?
  • Probably, but no guarantees.
To me the biggest thing in this 1.0 release is this:
  • The Code Pack also contains sample applications built using this library. Each sample has a C# version and a VB.NET version and has its own solution file.
That's right. VB samples in 1.0 of something. Thanks for noticing :-).

I am such a huge Code Pack fan (and have had a small hand in its birth) so this is just a wonderful summit to have reached. We've had over 24,000 downloads of Vista Bridge and the pre-release versions of Code Pack, so I am confident a lot of people are able to access Windows 7 features from managed code a lot more easily than they expected to.

Kate
Saturday, 08 August 2009 11:10:52 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 06 August 2009
If you like to learn how to do things from material that is longer than blog posts, and videos don't work for you, then you probably still buy books. Here's one you might be interested in:



Authors, in case you can't quite read it there, are Yochay Kiriaty, Laurence Moroney, and Sasha Goldshtein. I am often tempted to link to every post Yochay makes - they are detailed, and useful, and crammed with more links. If you're developing for Windows you should be reading his blog and that's that. I read Sasha's blog regularly, too, and he is constantly coming across things I would never have thought of. I may not need that information that day, but reading it makes me a better developer. Both of them give attention to both managed and native code for extra points from me. Laurence is more a Silverlight guy, but I'm going to read his blog for the next little while anyway.

I haven't seen a preview of the book yet, but it's due Sept 30th, and you know the content will be good. A pound and a half of developer good stuff :)

Kate
Thursday, 06 August 2009 08:49:51 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 04 August 2009
OK, technically you can't upgrade from XP to Windows 7. But that is what the nice guys at Language Log call nerdview. You can't click a button in the install process that has Upgrade on it and come back later to find that you are now running Windows 7. But you can follow a series of steps that takes you from your current XP installation full of applications and pictures and mailbox and IE favourites and desktop wallpaper and all that jazz, and end up with a Windows 7 installation full of all the same stuff. Well, not your applications, but all your data and your settings. That feels like an upgrade to most people, and if the applications they use are free (Messenger and other downloadable clients) or they have the installation materials and they only use 3 or 4 apps (say, Office) then this is a really simple process to follow. Scott Hanselman has all the details complete with screenshots and instructions.

Me, I'm going to repave. In fact I never fully paved when I went to RC - I've been using Remote Desktop to get to other machines around the office that have Visual Studio etc installed. That was mostly because I'd been through two hard drive failures in as many months and was suspecting the controller was wonky. This drive has lived long enough that I'm willing to install stuff on it now, so there's plenty of installing in my future :)

Kate

Tuesday, 04 August 2009 08:35:33 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 02 August 2009
I hate SharePoint sometimes. It's powerful, and strong, and free(ish) and does an amazing job. If you just want to install it and use it, there's really nothing to complain about. But it's greatest strength, and my greatest user-upper of swearwords, is that you can program against it. With each release, whatever I swore about last time is magically fixed (RunWithElevatedPrivileges FTW) but a whole pile of new misery sneaks in out of nowhere. (Well, and CAML remains, but I guess we can't do anything about that.) It's usually related to security, but not always, and the thing is that debugging it is always like surgery with oven mitts on.

I had a situation where I wanted to find the item you just added. Took a little searching, but I found it:

query.Query = "<Where><Eq><FieldRef Name='" & list.Fields.Item("Created By").InternalName & _
                "'/><Value Type='User'>" & SPContext.Current.Web.CurrentUser.Name & "</Value></Eq></Where>" & _
            "<OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy>"
items = list.GetItems(query)
The first entry in items is the thing you most recently added. OK, fine. But we have event receivers on these lists, and they go off asynchronously. That means that right after you saved an item, while the receiver is still processing, the item isn't returned by the query.

Well that made me grumpy but I understood, so I made a loop, and if the first entry in items wasn't recent enough (say, in the last two minutes) I would have a little sleep and then ask again. But no matter how long I waited (even 20 minutes!) this code never would find the item. Oh, there was swearing, you can be sure of that.

I decided that SharePoint must be caching the query results. But searching for things like "SPListItemCollection cache" just got me helpful tips on caching these results myself, some thread safety issues, and the like. For example, this MSDN article says

You might try to increase performance and memory usage by caching SPListItemCollection objects that are returned from queries. In general, this is a good practice; however, the SPListItemCollection object contains an embedded SPWeb object that is not thread safe and should not be cached.

Does that match up well with what I am seeing - always the identical results from this query-in-a-loop even though I know the underlying list has changed while the loop was running? It does not.

Then I found two blog entries by Jeff Crossett: first the complaint, and then the solution. He's right. And when I implemented his hack:

' use a random value in query so we don't get cached.
randomValue = generator.Next(100, 1000000000)
query.Query = "<Where><And><Eq><FieldRef Name='" & list.Fields.Item("Created By").InternalName & _
                "'/><Value Type='User'>" & SPContext.Current.Web.CurrentUser.Name & "</Value></Eq><Neq>" & _
                "<FieldRef Name='Title' /><Value Type='Text'>" & randomValue.ToString & "</Value>" & _
                "</Neq></And></Where>" & _
            "<OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy>"
items = list.GetItems(query)

We all lived happily ever after. Well, until the next WTF that SharePoint throws my way. I am doing amazing things with this product. My customers would pay more for their software if SharePoint didn't exist. But man, sometimes it is HARD.

Kate

Sunday, 02 August 2009 08:26:35 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 31 July 2009
It's time to start talking about TechDays (because among other things, I'm talking at TechDays :-).)



Joey has the details including a list of sessions. I'm in the Core Fundamentals and Best Practices track in Toronto, delivering these two talks:

Day 1, Session 1:
Tips and Tricks for Visual Studio

This session enhances your experience with Visual Studio. Keyboard shortcuts, macros, layouts, fonts, tools, and external utilities are all very powerful and underused features of Visual Studio. This session makes you more productive in Visual Studio. Bring your pen and pad because you'll definitely want to take notes!

Day 2, Session 4:
Database Change Management with Team System

If you develop database enabled applications on top of SQL Server, you owe it to yourself to considering doing it better with Visual Studio Team System. In this session, you’ll learn about changes to how the product works under the covers and what that means to you. Then, you’ll learn how to use the product to design, build, and deploy your databases to development, test, and production environments -- all with purpose and method instead of the more traditional madness that can be found in many shops in the wild.

I am a huge Data Dude fan, which makes the second session a natural, and as for the first one, I'm one of those people. When I present I'm nice and careful with lots of mouse clicking so everyone can see what I'm doing. But when I'm sitting down to code, I get a pretty constant chorus of "hey, how did you do that so fast?". Come and see how :-).

Kate

Friday, 31 July 2009 22:15:47 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 29 July 2009
I didn't even know there was a Visual Studio Project Team blog, but the entries lately sure have been C++ relevant:
Brian Tyler says "Our areas of responsibility are those surrounding projects and solutions in Visual Studio - specifically the C++, C# and VB project systems - but we're involved in other code bases in those areas as well." and explains that he's going to start the blog with these C++ topics because the conversion of the VC++ project system from VCBuild to MSBuild was a major effort in VS 2010.

I'm really happy about the VC directories thing. It made moving projects from one machine to another very brittle that things like which version of a header file you got were machine-specific instead of project specific. The blog as a whole is a must-read if you're going to do any C++ work in Dev10.

Kate

Wednesday, 29 July 2009 22:05:26 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 27 July 2009
If you want to start talking to developers about your technology, you're hardly the first. Whether you want to talk about the tech your company builds, or just tech that you like to use, or something a little in between (I don't make Microsoft software, or sell it, but since it's the platform I consult and mentor on, I have a financial interest in people using the tech I talk about) there is someone out there who is in the same boat as you.

Chris Heilmann, a web developer evangelist working for the Yahoo Developer Network, has written a handbook for developer evangelists. Trust me, what this handbook has to say is not Yahoo-specific, or web-specific, at all. It is developer-specific in parts, since demos and such are vital to us. Definitely worth a read - and if you want to speak on our tech, start doing some of this.

Kate

Monday, 27 July 2009 17:32:24 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 25 July 2009
A client asked me to help recently with a small mystery. They had a database provided by a customer and they'd been asked to import the contents into the tables used by their own product. One of the tables had a BLOB column and from context they were quite sure it was used to hold scans of documents. There was even a "filename" column and a "filetype" column that suggested very strongly the scans were stored as TIFFs.

It had taken a while to find code to read the blobs, and when they ran it, the resulting file was rejected as not being a valid TIFF. They weren't sure if they were handling the blobs wrongly, if the data was encrypted, or if it was some other image format (they had tried PDF and GIF already.) In a highly enjoyable two hours, here's what I did:
  • Found short (ten lines including initialization and cleanup) code to read one blob in VB6 and save it to disk.
  • Found the TIFF format details, looked in the resulting file with notepad and confirmed it didn't start either II or MM and so wasn't a TIFF.
  • Looked at a few other file formats but wasn't really gaining any knowledge, just ruling things out that you could rule out by renaming and double clicking, then having the file rejected by the app that tried to open it.
  • Discovered Marco Pontello's absolutely cool File Identifier, TrID, and downloaded it
  • Removed the extension from what had been test.tif, pointed TrID at it, and was told 100% it was a zip file. Duh, the file started PK, I might have guessed that one.
  • Renamed it to test.zip, unzipped it by hand -- ooh, it IS a zip! -- and was rewarded with file.txt for my trouble
  • Looked at file.txt in notepad and noticed that it was full of binary-looking gibberish, but it DID start with II
  • Hand renamed file.txt to file.tif and double-clicked it
  • Presto! A scan of a document!
I left my client to write the code that did all the blobs, including unzipping them and renaming (every single blog contained a zip which  contained a TIFF renamed to file.txt and no, I don't know why) from within a quickly written importer application. The big mystery was solved. Thanks, Marco!

Kate

Saturday, 25 July 2009 12:13:01 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 23 July 2009

I admit it, I read my referrer logs. I want to see what kinds of searches bring people here, or who is linking to me. I think a lot of the single word searches (women, or shirt, or december) are blog spammers looking for posts to spam on. And some are clearly my name, names of my friends or folks I blog about, conferences I'm speaking at. The majority is things I know about, things for which I want to be your expert source: /clr:pure, windows 7 taskbar, uac manifest file, marshal_as and so on. Yay.

But this one was just plain odd: c++ standard limerick. Really? So I repeated the search, and found this:

When writing a specialization,
be careful about its location;
or to make it compile
will be such a trial
as to kindle its self-immolation.

OK, it's not spaced like that in the standard. But who'da thunk it?

Kate

Thursday, 23 July 2009 19:48:20 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 21 July 2009

Want to go to PDC but not sure you can afford it? How would this work for you: a trip to PDC including flights, hotel, and conference admission?

That's the grand prize in the INETA Component Code Challenge. Write an app (web, client, whatever) that uses at least two different components (a grid and a chart? a PDF creator and a calendar? a report and a spreadsheet? You decide.) from the sponsors.

Try it! And maybe see you in LA!

Kate

Tuesday, 21 July 2009 19:40:35 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 19 July 2009

Here's another tip from Habib on debugging. If you have a particular screen you want to bring up, and it takes a lot of clicking and selecting to bring it up, why not just set a breakpoint and then bring it up by constructing and calling it with the immediate window?

Habib's video features a WPF application, and the constructor takes no parameters, but you could use this for Windows Forms and you could pass through whatever parameters you needed to. A very handy tip - any language, any kind of client application.

Sunday, 19 July 2009 19:35:20 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 17 July 2009

It's been a while since I did a series of posts on debugging tips:

So here is not so much a tip as an announcement. You see , it's no coincidence that my examples for conditional breakpoints were numbers (some index into a structure is greater than 346, or Xid is 1234.) Until now, you couldn't really use strings in conditional breakpoint expressions. But the cool news is that, starting with Visual Studio 2010, you can!

You can't just call arbitrary functions including your own foo(whatever), but you can call a pretty impressive list of variants on strlen and strcmp. The details on are Habib Heydarian's blog. Just one more reason to want Visual Studio 2010!

Kate

Friday, 17 July 2009 12:27:15 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 15 July 2009
Finally, XP2Win7 is released! I've been watching this one for a long time. It's designed to show off both Windows 7 features and development good practices. The same binaries behave differently on XP and on 7 - on 7 it lights up and shows 7 features like the taskbar or libraries support, as well as Vista features that never got the attention they deserve like Restart and Recovery.

The application itself is a photo viewer and that makes it a natural fit for hooking into libraries, search and organize, and the preview system. It has an intuitive jump list on the taskbar:

It also uses the new Sensor support, Aero glass effects, trigger-started services for backing up images when a USB key is inserted, MMC and Powershell integration, the new Event Tracing for Windows (ETW) and so much more. This will be your roadmap to Windows 7 development. Of course all the code is available, as well as a simple MSI if you'd just like to play with the application a bit and understand what Windows 7 has to offer.

Get your copy and start learning and exploring!

Kate

Wednesday, 15 July 2009 09:32:56 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 13 July 2009

A whole pile of really smart people, many of whom I am lucky enough to call my friends, have contributed to a new eBook on development topics. Check these titles:

  • Working with Brownfield Code by Donald Belcham (Microsoft MVP)
  • Beyond C# and VB by Ted Neward (Microsoft MVP)
  • Remaining Valuable to Employers featuring Barry Gervin, Billy Hollis, Bruce Johnson, Scott Howlett, Adam Cogan, and Jonathan Zuck
  • All I Wanted Was My Data by Barry Gervin (Microsoft Regional Director and MVP)
  • Efficiency Upgrade by Derek Hatchard (Microsoft Regional Director and MVP)
  • Getting Started with Continuous Integration by Sondre Bjellås (Microsoft Regional Director and MVP)
  • On Strike at the Software Factory by Daniel Crenna (Microsoft MVP)
  • C# Features You Should Be Using by Ted Neward (Microsoft MVP)
  • Accelerate Your Coding with Code Snippets by Brian Noyes (Microsoft Regional Director and MVP)
  • Is Silverlight 2 Ready for Business Applications? by Jonas Follesø (Microsoft Regional Director and MVP)
  • Innovate with Silverlight 2 by Daniel Crenna (Microsoft MVP)
  • Real World WPF: Rich UI + HD by Gill Cleeren (Microsoft Regional Director and MVP)
  • Hidden Talents by Peter Jones
  • Creating Useful Installers with Custom Actions by Christian Jacob
  • Banking with XML by Peter Jones
  • Sending Email by Derek Hatchard (Microsoft Regional Director and MVP)

Also, it has comics in it. Really. And if you prefer a printed copy, you can order one (black and white or colour) at a nominal cost. And these aren't little blog posts, they're decent length articles. All told the PDF is 132 pages. Each article conveys, on top of the technical information you'd expect, a glimpse into the personality and style of the author. A highly recommended download and read.

Update: This whole recommending thing works even better when you include a link: http://devshaped.com/book. Slow brain day today, I guess.

Kate

Monday, 13 July 2009 13:00:57 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 11 July 2009
Remember that post by Aaron Margolis I linked to about launching a non elevated app from an elevated one? I mentioned that he'd left the managed version of his code as an exercise for the reader. Well Sasha Goldshtein has taken up that challenge and written the managed code. Not only that, he's added it to his UAC Helpers project on CodePlex, a collection of code that helps you work with UAC. Nice!

Kate

Saturday, 11 July 2009 17:22:20 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 09 July 2009

We have a long running Agile project underway. Every month or so we deliver a new release, then work with the customer to decide what will be in the next release. Unlike many Agile shops, this isn't our only project - we have other small software development projects, mentoring work, and so on that take up about two thirds of the team's time, leaving one third for this project. What's more, we do this as a little fixed bid project every month, and both my bottom line and the customer are happy with the cost of each release. The key to that, of course, is accurate estimation of the effort in each iteration.

In some ways we have it easy now. The client has working code, and each month all we need to estimate are the changes and additions to that code. But how would it be if we were starting from nothing and planning to build a whole big system over the course of a year or so, for someone who wanted a fixed cost up front and a reasonably complete list of features to be delivered for that cost? Stephen Forte gave a talk recently on just that topic. Plenty of good ideas and a fun listen.

Kate

Thursday, 09 July 2009 07:38:19 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 07 July 2009

I do a lot of work in VB, though I am a C++ MVP not a VB one. This year at the MVP Summit many of the VB MVPs did short interviews with Beth Massi about how they got started and what they do in VB. Get to know some of these folks a little better. I spotted Julie Lerman, Rob Windsor, Ken Getz, Deborah Kurata, Daron Yondem, Jackie Goldstein, and even a thirteen year old! It's a mix of video interviews and text ones, and a very small time committment.

Kate

Tuesday, 07 July 2009 07:31:52 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 05 July 2009

Ian McKenzie has a funny list of 20 ways to tell you're Canadian. My only quibble is that for #4 I would say cottage instead of camp. Other than that, rock on!

Kate

Sunday, 05 July 2009 19:09:17 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 03 July 2009

At Tech Ed this year, a whole pile of my friends (and me too) were invited to pontificate a little on fairly light weight technical topics like "what technology have you enjoyed lately?" and "how do you keep up with everything that's changing all the time?". The result is a fun series featuring luminaries inside and outside Microsoft: Scott Hanselman, Billy Hollis, me, Richard Campbell, Stephen Forte, Clemens Vasters, Tim Huckaby, Michele Leroux Bustamente, Jim Wilt, Brian Noyes, Loke Uei Tan, Matt Hessinger, Don Box, Juval Lowy, Jeffrey Palermo, and Tim Heuer. They're being uploaded one a week or so - you can get started now and enjoy more later.

Here's a direct link to mine if you need it: http://msdn.microsoft.com/en-us/dd776253.aspx

Kate

Friday, 03 July 2009 17:08:51 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 01 July 2009

So I guess I am totally having a "get off my lawn" moment here. I read, on a blog I generally enjoy reading, the following rant about "bad customer service":

  • Why am I still required to fill out my personal details (city, birth date, job title) while registering on web sites, when all they need to do is fetch that data from my LinkedIn page?
  • Why does my new Internet provider give me a new email address (which I won't use), requiring me to read that mailbox regularly for service updates? Why not send me tweets?
  • Why do I have to go to the web site of my vendor of contact lenses to re-order my monthly set of lenses? Why not enable me to send a "reorder" message through Facebook?
  • Why does the agile 2009 conference require that I upload my presentation to their site, in PDF form with maximum size of 5 MB? Why not integrate with the much more advanced SlideShare where I already have an account?
  • Why do I get offers for products that I clearly don't want or that I already own, which can be easily deduced from my reviews, ratings, and rantings on various social sites?

Prior to this bulleted list was a complaint that an ISP hadn't magically noticed that some emails weren't reaching the ranter, and didn't email about it, or didn't go figure out what @tag to use in a Tweet so that their customer would know there was a problem with some emails. I mean really, "send me a tweet"? Tweets are broadcast messages, not one-on-one communication, aren't they?

Good heaven. If I went to a random web site and on the registration page entered "Kate Gregory" (or "Barack Obama") and it trundled off to LinkedIn and filled in where I live, what I do, my birthday etc I would be majorly creeped out and want nothing to do with that web site. Maybe, just maybe, I would be ok with a button that said "go find this out on the public web" but I doubt it. I think OpenID is a better way to go, and I do appreciate that most Microsoft sites now just let me use my Live ID, but for sites with no business relationship to share what they know about me just creeps me right out. Reorder contact lenses on Facebook? What does Facebook have to do with buying stuff from completely unrelated third parties? Why would it be a good thing to put intermediaries (Facebook, Twitter etc) in all my transactions? The big excitement of Web 1.0 was that it took intermediaries out of the picture and let me interact directly with the producers of the things I wanted to buy. One of the major inconveniences of Web 2.0 is excited under-30's (sorry to generalize, a handful of over-30's are excited like this too) making me sign up for yet another account on yet another Social Networking Silver Bullet that they are going to use to manage their event/project/party/virtual team.

I disagree with the fourth bullet, too. I would much rather just be told where to upload my stuff and be done with it. I also have some empathy for folks who want to use the same way to communicate with everyone on a reasonably large list. Can you imagine the job (probably unpaid in his or her free time) of the conference organizer who says "everybody please put your slides somewhere, anywhere on the web that works for you, and send me the link, and here are links to free places you can put your slides in case you're not on SlideShare." And this organizer probably still has to run the upload-your-slides here site for everyone who doesn't have an account somewhere else. And has to accept and send not just emails about it (with or without links) but also tweets, blog posts, and comments on one speaker's YouTube channel and another speaker's CodePlex project home page, because why should they be obliged to look in more than one place for attempts to communicate? And then this poor organizer needs to know how to download from 10 or 20 different document sharing sites, and register for notifications if they're changed, because the speaker figures uploading new docs and not telling anyone will be fine, since after all the site sends notifications if they're changed.

The last bullet is hilarious. Dude, I get offers for things that I clearly don't want. The spammers can't be bothered to check my gender or what country I live in. You really think they're going to check your MySpace to see you already tried acai berry and whether it worked for you or not?

But under all that rankling and disagreeing is the germ of a really important truth. Just as David Platt likes to say "Know your Customer, for he is not you", I can see that I might not offer enough options to the millennials, and they might not offer enough options to my and my fellow post-boomers. It's an interesting culture clash considering we write software for each other, and one that's worth thinking about. If a customer service department doesn't offer service the way you want it, if the conference speaker wrangler doesn't wrangle speakers the way they want to be wrangled, if my software doesn't let you talk back to me the way you want to talk back to me and if I don't listen when you talk the way you want to, then that's a problem. Hmmm.

Kate

Wednesday, 01 July 2009 16:51:06 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 29 June 2009

I'm a big Ramsay's Kitchen Nightmares fan. I wildly prefer the English series (also true for The Apprentice and several other "reality" shows) because he cares more on those than on the US-edited ones. I'm also a big Steve Clayton fan. So when Steve says "It was like watching an episode of Ramsay’s Kitchen Nightmares (minus swearing). I watched the first episode start to finish…I can’t remember the last time I watched such a long video on the web" that is endorsement enough for me.

I watched it and it was indeed both entertaining and instructive. How could a big company launch a whole new initiative, commission a ton of software for their customers to use, and not have software for the back office to use to manage it all? Why does it take an outside consultant to say to one guy "how much of your time goes to this?" and to another guy "is that enough?" and then present the result to the CEO, who (no surprise) promptly authorizes some hiring? I may never launch a global initiative in Paris, New York, and London and spend a few million in each city before setting to work to make it profitable, but I'm still glad I watched the video. And as the person who sometimes asks the two questions that were never asked in the same room before, it is nice to know the demand for simple questions at the heart of the matter will never fade.

Kate

Monday, 29 June 2009 09:39:57 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 27 June 2009

I sure do love using the Windows 7 taskbar. (I might have blogged a few times about it already.) I have completely internalized the habit of right-clicking on a running app (or a pinned icon for a non-running one) to open a recent document - whether that app is Word, Notepad, PowerPoint, or whatever. I right-click any Messenger conversation to change my status, and I close instances right from the taskbar preview window. I wish Outlook would give me 5 or 6 jumplist items, like New Message and New Appointment, and I really wish Visual Studio would give me some options too. I am looking forward to new releases that will harness this intuitive way of getting users closer to the files they want to open or the things they want to do.

If you want to put taskbar support into your application, and you're not really a video kind of person, perhaps an MSDN Magazine article will do the trick? Yochay and Sasha should be familiar to my readers - you know these guys know their stuff. The article covers both native and managed development, and concludes with this summary:

In this article, we have explored some features of the Windows 7 taskbar, such as application IDs, thumbnail toolbars, overlay icons, progress bars and jump lists. The Windows 7 taskbar provides a clean, sleek launch surface that strongly benefits users. Integrating into this surface will be a primary goal for any application developer for Windows 7.
Using the native Win32 APIs or the managed Windows API Code Pack provides you with a differentiating opportunity to light up your applications on Windows 7. Bear in mind that the taskbar is the first thing users see after logging on to Windows, and you'll want your application to be pinned to their taskbar.

I completely agree. Give it a read.

Kate

Saturday, 27 June 2009 08:05:20 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 25 June 2009

The Build a Better App site is all about applications. They've gathered tutorials, videos, and useful libraries for folks who are building client applications. You'll see some old friends of mine on the main page - Code Pack, Tim Huckaby's recent guidance paper, and so on - along with plenty of things I haven't linked to from this blog. But there's more, like profiles of some of the people whose work is on the site (love the fish, Tim) or videos showing the Windows Forms to WPF converter in action, Code Pack demos, and so on. Speaking of videos, Build a Better App has their own channel on YouTube, as well. Jono Wells is twittering on behalf of the site, and blogging too.

If you were at Tech Ed USA, you probably saw the Build a Better App team - they had a colourful presence and fun stickers and clings. There's a slideshow of some of the "better app requests" from attendees and while I doubt anyone will be coding a cloak of invisibility any time soon, there were some pretty cool requests in there.

Take a look around, and if you want to submit some content for the site, let me know and I'll connect you to the right people.

Kate

Thursday, 25 June 2009 07:54:21 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 23 June 2009

WPF uses XAML. Silverlight uses XAML. WPF is mostly for writing client (Windows) apps, but XBAPs run in a browser. Silverlight is for the web, but an offline story is planned. It's easy to get confused. Worse, people often feel there is a "vs" aspect to it - Silverlight vs WPF. Mike Taulty puts it like this:

Of course, it's not a fist fight. Mike goes on to elaborate on the continuum of technologies and the way you can share skills between them. He also points to a post by Karl Shifflet that demonstrates how code can be reused between WPF and Silverlight applications.

A vital reference for anyone who is moving around on this continuum is a whitepaper (with companion code) that highlights the similarities and differences between WPF and Silverlight. It's available on Codeplex now. It's full of detailed summaries like this:

Check it out!

Kate

Tuesday, 23 June 2009 17:43:59 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 21 June 2009

Some simple truths about elevation (as in UAC):

  • A process, once running, cannot elevate itself. You are launched elevated or not.
  • A non elevated process can launch an elevated one. The easiest way is to make a separate exe and embed a manifest, then launch it with ShellExecute.
  • An elevated process, once running, cannot "drop back down" to being elevated. As in the first bullet, you are launched elevated or not.

There are some incredibly complicated ways to launch an elevated process but I don't use them because they are incredibly complicated. But you might have noticed there's a symmetry problem there. Can an elevated process launch a non elevated one? My first answer would be "it doesn't matter, because you shouldn't." My paradigm is that your core app should be non elevated, if at all possible, and if it has one or two admin-ish features, those should be refactored into a separate manifested exe that is launched (from a UI component decorated with the shield), does its stuff and gets out.

However, a case can be made for having some sort of admin app that wants to leverage some other installed application, like Internet Explorer, that could possibly be using a malicious plugin or the like. This admin app would be smart to do its leveraging with a non elevated instance of that application. So how can you do it? Well, according to Aaron Margosis, it's a seven step process in native code. Managed code is left as an exercise for the reader.

If you care, now you know how to do it. And even if you don't care, the symmetry is restored.

Kate

 

Sunday, 21 June 2009 17:30:28 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 19 June 2009

If you already know what NDepend is, all you really need to know is that you can now point CppDepend at some big legacy C++ codebase and start to get your arms around all that code a bit better. If you have vaguely heard about NDepend but weren't really listening because you're a C++ programmer, it's time to change that. You can start by reading an analysis of MFC that uses CppDepend to answer questions like what fraction of member variables have names that start m_ (answer: about half) or what kind of coupling the key classes tend to live with.

Beatiful visualizations and genuine insight. Sure, you're not going to refactor MFC yourself, but imagine pointing all this at your own library!

Kate

Friday, 19 June 2009 14:47:30 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 17 June 2009

An interesting article about the "hockey handshake" tradition. One of the first things I needed to understand when I started watching baseball was the handshake thing. 

At the end of a big hockey game, the teams shake hands with each other, that is each player shakes hands with each and every one of the opponents, and generally not with their own teammates at all. I was used to that and I see that as a "ok we were hitting each other, but no hard feelings."

 (from happymooses)

But at the end of a big baseball game, the winning team shakes hands amongst themselves, that is each player shakes hands with roughly half of their team-mates (the ones on the field shake with the ones who were off the field) while the losing team disappears as fast as they can.

 (from smailtronic)

It's tempting to see this as a fundamental Canada/US dichotomy, but it's more a baseball/hockey thing and I suspect it's because hockey is a contact sport and baseball (at least on paper) is not. Forgiving the person who has bruised you and saying "good game" is probably a lot more important in contact sports. And indeed, it seems that football goes for the "shake the opponents hands" tradition.

I have to say I'm more the hockey handshake than the baseball handshake type, even though I'd rather watch baseball than hockey most of the time. I really like the idea of taking the time to reconnect with the opponent and affirm that you're really all part of a large thing (the league and the sport) and are colleagues in that effort. In the same way, everyone in this business is a colleague, even if we compete from time to time.

Kate

 

Wednesday, 17 June 2009 22:25:19 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 15 June 2009

Version 0.9 of the Windows API Code Pack for the Microsoft .NET Framework was released June 11th. This version works with the RC, adds a number of exciting new Windows 7 features, and also incorporates many of the Vista Bridge features as well. (I posted earlier about the different versions of Vista Bridge and Code Pack.) Not only that, but it features VB samples as well as C# ones! You can also see some videos of the functionality in action.

 

You just won't believe how easy Windows 7 development is from managed code using the Code Pack until you give it a try. Expect to see more releases as the year goes on, and keep talking to the team on Code Gallery.

Kate

Monday, 15 June 2009 21:28:09 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 13 June 2009

Early this spring I delivered several sessions of training for Microsoft. It was for ISVs who wanted to get rolling on Windows 7 as quickly as possible. It's good material that covers a mix of managed and native development to take full advantage of new APIs, new features, and new power in Windows 7. It relies on the Windows API Code Pack and some custom-written wrappers for Windows 7 functionality that isn't in Code Pack at the moment. And now it's available to anyone who wants it.

If you couldn't come to one of the courses I taught, consider this the next-best thing.

Kate

Saturday, 13 June 2009 21:18:13 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 11 June 2009

Seems like a can't-lose offer, doesn't it? Free developer licenses of WPF controls (Calendar, Carousel, Chart, ColorPicker, DatePicker, Expander, Gauge, GridView, MaskedTextBox, NumericUpDown, PanelBar, ProgressBar, Scheduler, Slider, TabControl, TimePicker, TreeView) from Telerik. And don't be scared off by "developer license": they say "The Developer License is perpetual and has no deployment limitations – it allows the use of the controls for an unlimited number of applications spanning various servers and domains. The applications you develop with the Telerik WPF controls can be distributed royalty free." That sounds pretty no-strings and truly free to me.

What are you waiting for? Go get your controls!

Kate

Thursday, 11 June 2009 21:12:18 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 09 June 2009

I finally got around to listening to the last recorded webcast in this spring's Ignite Your Career webcast series from Microsoft Canada. Joey has a handy set of links to all the episodes on the Canadian Developers Blog. This series is very different from most Microsoft webcasts - it's not really about technology. It's about the things you need to learn to advance your career that are not straight technology like picking up a new language or a new development paradigm.

  • Industry Insights and Trends (featuring Joel Semeniuk)
  • Discovering Your Trusted Resources (featuring Richard Campbell)
  • How to Establish and Maintain a Healthy Work/Life Balance
  • How to Become a Great Leader (featuring Barry Gervin)
  • Building, Managing and Strengthening Your Team
  • Women in IT Panel Discussion

All the webcasts have been recorded and are well worth a download and a listen.

Kate

Tuesday, 09 June 2009 21:04:12 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 07 June 2009

I grew up in Southern Ontario (Kitchener Waterloo area) before moving to Toronto and now to my current home between Toronto and Peterborough, which possibly isn't Southern Ontario any more. Imagine my surprise, reading an article in The Economist, to come across this:

Ms Munro comes from southern Ontario, an area of considerable psychic murkiness and oddity. Her stories dwell on her own people and their peculiarities: their repressed emotions, respectable fronts, hidden sexual excesses, outbreaks of violence, lurid crimes and long-held grudges.

Psychic murkiness, eh? If you say so.

Kate

 

Sunday, 07 June 2009 19:03:30 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 05 June 2009

Well, obviously some programmers are poor communicators, just as some programmers are good painters or poor singers. But Leon Bambrick (Secret Geek) says "the better you program, the worse you communicate." And he means it. Basically good programmers have a number of habits that work well when talking to (or listening to) a compiler, but hurt you when you're dealing with people. And the comments dig in to the "how can I get better?" part of the problem. Worth a read.

Kate

Friday, 05 June 2009 18:59:25 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 03 June 2009

Further to that video of Brian Noyes and client technologies, Tim Huckaby has written a terrific paper on the topic. His personal history and experience position him perfectly to understand the real technical reasons (as well as the make-your-boss-happy or the go-home-on-time ones) why you should use a "smart client", "rich client", "Windows client" application for certain kinds of applications. He also knows when you shouldn't. Definitely recommended reading and if you want to tell him your thoughts, he's set up a blog post for comments.

Kate

Wednesday, 03 June 2009 18:34:38 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 01 June 2009

We have all worked with star developers. When I come into a client to mentor, occasionally they have one developer who is just a star. I can pretty much spot them in the first half hour these days. Other times they have a developer who would say "I am a star" but who wouldn't get that designation from me. Tim Stall has a nice list of things that make a developer a star. As I went through the list I was thinking "yes! yes!" and finally "hire! hire!" which is also what happens when I meet real stars. (Don't worry, I have never poached a dev from a client and never would, but "would you hire this person" is still an incredibly useful summary of someone's skills.) I especially like "22. Knows when the rules do not apply". It can't be taught, and dear heaven can people get this one wrong. When you meet someone who gets this right, it is such a relief.

The list doesn't tell you how to become that sort of person, but I am quite sure the rest of the Internet has some hints. So will I if I meet you in a mentoring context.

Kate

Monday, 01 June 2009 18:24:44 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 30 May 2009

An illuminating post from Dr. Rick Kirschner on bringing out the best in others. He gives ten specific rules, which act as nice reminders only after you've read the paragraphs that go with each. A lot of this maps well to things I am doing and things I have read elsewhere, but in far longer than a paragraph. Other things, like "useful assumptions" are new and bring me an "aha" that I enjoy.

Read it over and see if you don't learn something.

Kate

Saturday, 30 May 2009 18:06:04 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 28 May 2009

Stephan has blogged some breaking changes to the STL in beta 1 of VS 2010. These are breaking in the sense that your old code, which worked, might not work when you move it to the latest release. I had this with a demo (not real code) that didn't bother #including <iterator> because it was including something else that included it etc. So my old code wouldn't build in Dev10. Simple enough fix to add the #include.

That alone (4 simple problems, and how to fix them) makes the post worth reading. But it's also a fantastic example of the transparency and visibility the team blog provides. Look at this sentence:

In VC10 Beta 1, I added operator->() to CAdapt, allowing v[i]->Something() to compile unchanged. 

Not "we added". Not "it was decided to add". Not "some faceless decider, whose motives and reasoning are not accessible to the mere mortals who just read our decisions, added". Simply "I added". Stephan, STL, a real person whose posts we can recognize by font alone, added an operator. I think as C++ developers we are a very lucky lot, to have this kind of window into how and why the tools change as time goes by.

The conversation continues in the comments, btw. On the C++ team blog, if a post interests you, you should always read the comments too. Folks ask stuff and team members (not always those who posted the original) answer.

Kate

Thursday, 28 May 2009 21:33:33 (Eastern Daylight Time, UTC-04:00)  #