Showing tag results for Other

Apr 23, 2007
Post comments count0
Post likes count1

Psychic debugging: When reading unfamiliar code, assume it's mostly correct

Raymond Chen
Raymond Chen

You may be called in to study a problem in code you've never seen before or be asked to look over a proposed change to some code you've never seen before. When this happens, you have to take shortcuts in your analysis because following every function call to the bottom would not only take far too much time, but also take you so far away from the c...

Other
Apr 17, 2007
Post comments count0
Post likes count1

The Notepad file encoding problem, redux

Raymond Chen
Raymond Chen

About every ten months, somebody new discovers the Notepad file encoding problem. Let's see what else there is to say about it. First of all, can we change Notepad's detection algorithm? The problem is that there are a lot of different text files out there. Let's look just at the ones that Notepad supports. 8-bit ANSI (of which 7-bit ASCII is...

Other
Apr 16, 2007
Post comments count0
Post likes count0

Changes to power management in Windows Vista

Raymond Chen
Raymond Chen

As I noted some time ago, it's hard to get programmers excited about power management. What's worse, programs that do take the effort to care about power management often do it rudely, hijacking your computer and preventing you from going into standby or hibernation, instead preferring to drain your battery until the computer just dies from lack ...

Other
Apr 6, 2007
Post comments count0
Post likes count0

Code is read much more often than it is written, so plan accordingly

Raymond Chen
Raymond Chen

Design for readability. Even if you don't intend anybody else to read your code, there's still a very good chance that somebody will have to stare at your code and figure out what it does: That person is probably going to be you, twelve months from now. When I advised against the use of function parameters, one commenter pointed out that Intel...

Other
Mar 28, 2007
Post comments count0
Post likes count0

The social skills of a thermonuclear device, part 4

Raymond Chen
Raymond Chen

Last summer, one of my colleagues thought it would be fun to have an informal "lunch chat with Raymond" as a special treat for our summer interns. One of the interns reacted to the invitation a bit unexpectedly, asking meekly, "Is he going to yell at us?"

OtherThe social skills of a thermonuclear device
Mar 28, 2007
Post comments count0
Post likes count0

Why are there both TBSTYLE_EX_VERTICAL and CCS_VERT?

Raymond Chen
Raymond Chen

There are two ways to make a vertical toolbar. You can use the common style, or you can use the extended style which is specific to the toolbar. Why are there two ways of doing the same thing? Because we messed up. Whoever created the extended style didn't realize that there was already a perfectly good way of specifying a vertical toolbar (na...

Other
Mar 21, 2007
Post comments count0
Post likes count1

You don't know what you do until you know what you don't do

Raymond Chen
Raymond Chen

Many years ago, I saw a Dilbert cartoon that went roughly like this. Frame 1: Supertitle - "Dogbert's guide to project management." Frame 2: Supertitle - "Not a project." Dilbert answers the phone. "Sure, we do that." Frame 3: Supertitle - "A project." Dilbert answers the phone. "No, we don't do that."† I've seen a lot of software projects, ...

Other
Mar 20, 2007
Post comments count0
Post likes count0

I bet somebody is looking to get a really nice bonus for that feature: Uninstall

Raymond Chen
Raymond Chen

A customer asked the following question (paraphrased): Does the Windows XP Add/Remove Programs control panel expose a scriptable object model? We want our program to open the Add/Remove Programs control panel and uninstall the programs of our competitors. No, there is no object model for the Add and Remove Programs control panel, and it fri...

Other
Mar 14, 2007
Post comments count0
Post likes count0

Don't require your users to have a degree in philosophy, episode 2

Raymond Chen
Raymond Chen

Earlier, we learned that help text is not the place to put logic puzzles. Neither are dialog boxes. I ran across a configuration dialog box that had the item Turn off Feature X This is a negative-sense checkbox, which turns your dialog box into a logic puzzle. Checkboxes should be phrased positively. Use Feature X (The only except...

Other