Joel Spolsky says in one of his essays:
1. While recording a macro, you use Edit|Paste. What should happen when replaying the macro?
a) the macro should insert the same exact text that got inserted by Paste when recording.
b) the macro should insert current clipboard contents (or nothing if the clipboard is empty)
2. While recording a macro, you use the File|Save As command and specify a new name for the document. What should happen when replaying the macro?
a) the current document should be saved using the same filename that was specified while recording (possibly overwriting an existing file)
b) the macro should display the "Save As" dialog box, letting you specify a name, just as if you clicked File|Save As manually.
3. While recording a macro you select some text and click Format|Bold. The text was using normal style before, so now it is bold. What should happen when replaying the macro?
a) regardless of whether current selection is bold or not, the macro should make the text bold (leave it bold if it was bold already)
b) the effect should be the same as manually clicking Format|Bold: if text was normal, make it bold; if text was already bold, make it normal.
There is no perfect solution, of course. Each a and b choice has its downsides. Number 3 is especially bothersome for me, because it's very common to have this kind of toggle, and I can't decide which behavior is more useful or more "natural".
All (a) choices are "do exectly what happened while recording", while all (b) choices are "do what would happen if the command was invoked manually in the current document". So what is your preference? Straight As, straight Bs, or some combination?
marek
Quote
A user interface is well-designed when the program behaves exactly how the user thought it would.It's also been called principle of least astonishmentw. So here's something that's been puzzling me for a long while: the behavior of macros. Leaving aside how macros work in popular software like Word, how do you expect macros to behave in these three situations?
1. While recording a macro, you use Edit|Paste. What should happen when replaying the macro?
a) the macro should insert the same exact text that got inserted by Paste when recording.
b) the macro should insert current clipboard contents (or nothing if the clipboard is empty)
2. While recording a macro, you use the File|Save As command and specify a new name for the document. What should happen when replaying the macro?
a) the current document should be saved using the same filename that was specified while recording (possibly overwriting an existing file)
b) the macro should display the "Save As" dialog box, letting you specify a name, just as if you clicked File|Save As manually.
3. While recording a macro you select some text and click Format|Bold. The text was using normal style before, so now it is bold. What should happen when replaying the macro?
a) regardless of whether current selection is bold or not, the macro should make the text bold (leave it bold if it was bold already)
b) the effect should be the same as manually clicking Format|Bold: if text was normal, make it bold; if text was already bold, make it normal.
There is no perfect solution, of course. Each a and b choice has its downsides. Number 3 is especially bothersome for me, because it's very common to have this kind of toggle, and I can't decide which behavior is more useful or more "natural".
All (a) choices are "do exectly what happened while recording", while all (b) choices are "do what would happen if the command was invoked manually in the current document". So what is your preference? Straight As, straight Bs, or some combination?
marek










<bold/> by itself would toggle, and then there's <bold on="true"/> and <bold on="false"/> to force it either way. I'm sinplifying the syntax here, but just to give the idea.