Holy cow, I wrote a book!
The great thing about parameter validation is that there are people
who say that only idiots would have it,
and other people who say that only idiots wouldn't.
Back in the old days,
Windows didn't do parameter validation.
If you called a function with an invalid window handle,
your application crashed.
If you called a function with an invalid pointer,
your application crashed.
If you called a function with an invalid bitmap handle,
your application crashed.
There was a lot of crashing going on.
These crashes manifested themselves in the infamous
Unrecoverable Application Error dialog,
commonly known as the UAE message.
added parameter validation to all of the functions in
If an application passed an invalid
window handle, then instead of crashing,
it just got an error back.
This change was met with derision.
"Oh, I'm so impressed.
You finally got around to doing something you should have
been doing all along.
Not doing parameter validation was a totally idiotic decision."
But nowadays, parameter validation is out of fashion again.
If you detect an invalid parameter and return an error code,
then all you're doing is masking a latent bug in the application.
It should crash and burn with a big red fat'n'ugly blinking exception.
In other words,
we should go back to the way things were before we added parameter
(Well, except that the bit fat ugly exception wasn't red and it
Who's the idiot now?
would like to know
why the word Start disappeared from the Start button
in Windows Vista.
adding the word Start helped new users figure out what they should click
I don't know but I can guess.
To emphasize that these are guesses, I went back in
after I wrote them and added all sorts of weasel words.
It sort of saps the punch from the statements,
but it's one of those things I've learned that I have to do
to avoid the more egregious forms of willful misunderstanding.
First of all, it might have been a leftover from one of the older
designs for the Vista taskbar,
one which, as I dimly recall,
changed the default taskbar docking position from
the bottom of the screen to the right-hand edge.
(I am under the impression that
this design may have been shown off at a PDC from a few years
ago, but perhaps not.)
Under those circumstances, we would be in the situation where
the word Start disappears,
so there would be no point showing a helpful piece of text when the only
people it helps would be people who wouldn't know how to re-dock the
Second, the design folks might have
wanted to give Windows Vista a distinctive
and a fancy new Start button could serve as one of those elements.
introducing a new element with a new design might be one of those
things that lawyers like to see,
because it might make a copyright claim more defensible.
As I recall,
during the period of Windows Vista development,
there was an ongoing issue with a competing operating system
which appeared to have
copied many visual elements from Windows XP,
and I'm guessing that
lawyers like it when a new element is even more distinctive,
because, in my totally uninformed, unofficial, and untrained legal opinion,
doing so might help to remove the defense that the element is generic
and therefore is not subject to copyright.
Yes, the word Start was added specifically to address
a usability concern,
but it may have been the feeling that in the over ten years
since the Start button was introduced,
people had been exposed to it in other ways,
perhaps even ways
they didn't expect.
You may have noticed that
the Start button cues have been slowly disappearing over the
The big dialog box that appears the first time you boot Windows
which has a miniature screenshot with an arrow pointing to the
Start button? Gone.
The arrow that animates across the taskbar which says
Click here to begin?
By the time the first-time user has reached the desktop,
the circular Windows Vista logo has been presented numerous
It's on the boot screen,
it's on the logon screen,
it's on the box packaging.
When it appears in the corner of the screen,
the feeling of the designers may have been that
the user has already been nudged plenty of times into clicking on it.
Back in the late 1980's,
when NETBIOS ruled the land at Microsoft,
one of my colleagues ran a pirate radio station on the Microsoft
Let's call this colleague
my generic name for a Microsoft employee.
Bob had converted a bunch of songs to WAV
format (mp3 not yet having been invented)
and kept them on his machine to listen to while he worked.
But he also travelled from room to room to investigate
problems in various offices and labs.
This was also the days before laptop computers and iPods.
A portable computer was
one of these puppies,
affectionately known as a luggable
because it was the size of (and weighed more than) a suitcase.
Bob liked to listen to music while he worked,
and since he couldn't take his music with him,
he did what he thought was the next best thing:
He had his music come to him.
Bob wrote a program to stream his music collection over the
Microsoft corporate network.
Of course, Bob didn't want to have to pre-program
the list of offices and labs he was going to visit during
the day (in part of course because at the start of the day,
he didn't know where he was going to be),
so the program broadcasted his music collection to every computer
That way, no matter where he (or anybody else) was,
he could listen to his music collection.
He called this service Radio Free Bob.
Radio Free Bob was not on the air for very long, however,
before getting the heat from The Man.
Pumping that much data to every computer at Microsoft,
even the machines in overseas offices like Hong Kong and Berlin,
doesn't sit well with corporate network administrators.
I don't know the exact number, but it was consuming some
huge percentage of the network bandwidth of the
The IT department frantically triangulated the packets,
identified the building that was the source of the network broadcasts,
narrowed it down to a specific wing of the building,
then began a room-by-room search for the offending computer,
descending upon it like a SWAT team.
Thus ended the short life of Radio Free Bob.
Time for the semi-annual link clearance.
And, as always, the obligatory plug for my column in
When doing high-performance computing, you need to worry
about the CPU cache line size in order to avoid issues
like false sharing.
But how can you determine the processor's cache size?
The GetLogicalProcessorInformation function
will give you characteristics of the logical processors
in use by the system.
walk the SYSTEM_LOGICAL_PROCESSOR_INFORMATION
returned by the function looking for entries of type
Each such entry contains a ProcessorMask which tells
you which processor(s) the entry applies to,
and in the
it tells you what type of cache is being described
and how big the cache line is for that cache.
Windows 7 adds the function
which does the RelationCache filtering for you.
Commenter denis bider considers accessiblity an altruistic endeavor
and suggests that
it would be more efficient to outsource accessibility to another
Sure, why not.
Just like in real life, you can hire someone to do your programming
taxes for you.
If you would rather hire another company to come in and add
accessibility support to your application, then more power to you.
Yes, accessibility is one of those altruistic things,
but so too is not consuming 100% of the CPU all the time,
or being usable at high DPI or color schemes different from the
Sure, you can write your program so it doesn't work at high DPI,
and requires the user to use the Windows default color scheme,
and consumes 100% of the CPU all the time,
but each time you do this, you alienate another percentage of
(Not supporting accessibility will cost you a pretty large audience,
because governmental agencies usually have accessibility
as one of their requirements.)
And don't be so sure that the audience that appreciates accessibility
is just your test team and people with disabilities.
It also means that people can't write tools that
extract the text from your program
use voice recognition to control your program.
The Windows 7 taskbar automatically groups similar windows,
and when you right-click on the grouped icon, you may get fancy stuff
like a jump list or a task list,
but you will also get a very small repertoire of window management
In particular, the only option that operates on the group is
Close all windows.
What about the other group options?
To get a list of more group window options,
hold the shift key when you right-click on the grouped icon.
Then you'll get more options like Cascade and
Minimize all windows.
Since the contents of the regular right-click pop-up window
when you hit "C" for Close all windows,
it still waits for you to confirm by hitting Enter.
On the other hand,
the shift+right-click menu auto-executes
Close all windows when you hit the "C" hotkey.
Doesn't save you any more keystrokes (trading an Enter
for a shift key), but you do get predictability
since the shift+right-click menu is pretty stable.
Bonus tip: To get the System menu for a window,
you can right-click on its pop-up thumbnail.
My wanderings through the online world of bridesmaid craziness began with
Brides taking their bridesmaids for Botox treatments or maybe
a boob job.
I blame the
wedding-industrial complex, which constantly pushes weddings
as the bride's "perfect day",
"the best day of your life",
a "fairy tale come true"
where you can be
"a princess for a day."
(Folk tales which end in big lavish weddings are told from the female
point of view;
there aren't many folk tales about the young boy who grows up to marry
a beautiful princess.)
And I love Elizabeth A.'s comment called out in the sidebar
to the New York Times article.
Back to that article:
Is the Botox girl's night out a real trend or a
Pre-nups for bridesmaids. Gain weight and you're out,
the author claims that
"one in five women actually ask their bridesmaids to sign a pre-nup."
On that, I call fake trend.
First of all, I could find only one actual documented case of
a bride who made her bridesmaids sign contracts agreeing
not to gain weight before the wedding.
it was a prank.
so if it happened only once,
where did this "one in five" come from?
I followed the citation to
the source article in The Daily Mail,
which merely says that one in five would ask their bridesmaids
to sign such an agreement, not that one in five actually did it.
But wait, there's more.
I followed the citation from that Daily Mail article to the
the original survey from You & Your Wedding magazine,
and found that it was even weaker than The Daily Mail described it:
The actual result was that one in five
would consider a bridesmaid contract in general.
So we're double-counterfactual now.
And the survey was not scientific;
it was just an online survey.
Okay, so let's tally up the numbers.
The claim that one in five brides ask their bridesmaids to sign a
pre-nuptial agreement which includes a clause regarding weight
would be true if...
I call fake trend.
Extreme wedding planning.
Warning: Contains bad dancing.
Every so often,
someone posts a really funny comment, and I feel stupid just
posting the remark "Haha, that was funny" or even worse "LOL".
So I'm going to try giving them a star instead.
Chris Blackwell wins the first star.
Hopefully people won't post comments just fishing for a star.
(I realize that this is a vain hope and that I will probably have
to cancel the star program within the week.)